moved ExpressionControlBusFactoryBean into config instead of config.xml

This commit is contained in:
Mark Fisher
2010-11-13 12:37:42 -05:00
parent ff3604e972
commit 9e565ab3c9
2 changed files with 1 additions and 59 deletions

View File

@@ -18,6 +18,7 @@ import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.ExpressionControlBusFactoryBean;
import org.springframework.integration.control.ControlBusMessageProcessor;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;

View File

@@ -1,59 +0,0 @@
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.springframework.integration.config.xml;
import org.springframework.expression.BeanResolver;
import org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean;
import org.springframework.integration.control.ControlBusMessageProcessor;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.handler.ServiceActivatingHandler;
/**
* FactoryBean for creating {@link MessageHandler} instances to handle a message as a SpEL expression.
*
* @author Dave Syer
*
* @since 2.0
*/
public class ExpressionControlBusFactoryBean extends AbstractSimpleMessageHandlerFactoryBean {
private volatile Long sendTimeout;
private volatile BeanResolver beanResolver;
private final ControlBusMessageProcessor processor;
public ExpressionControlBusFactoryBean(ControlBusMessageProcessor processor) {
this.processor = processor;
}
public void setBeanResolver(BeanResolver beanResolver) {
this.beanResolver = beanResolver;
}
public void setSendTimeout(Long sendTimeout) {
this.sendTimeout = sendTimeout;
}
protected MessageHandler createHandler() {
if (beanResolver!=null) {
processor.setBeanResolver(beanResolver);
}
ServiceActivatingHandler handler = new ServiceActivatingHandler(processor);
if (this.sendTimeout != null) {
handler.setSendTimeout(this.sendTimeout);
}
return handler;
}
}