Class AbstractSimpleMessageHandlerFactoryBean<H extends org.springframework.messaging.MessageHandler>
java.lang.Object
org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean<H>
- Type Parameters:
H
- the target message handler type.
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.FactoryBean<org.springframework.messaging.MessageHandler>
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationEventPublisherAware
- Direct Known Subclasses:
AbstractStandardMessageHandlerFactoryBean
,AggregatorFactoryBean
,ExpressionControlBusFactoryBean
public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends org.springframework.messaging.MessageHandler>
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<org.springframework.messaging.MessageHandler>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationEventPublisherAware
Factory bean to create and configure a
MessageHandler
.-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Log
logger
-
Constructor Summary
Constructors Constructor Description AbstractSimpleMessageHandlerFactoryBean()
-
Method Summary
Modifier and Type Method Description protected abstract H
createHandler()
protected H
createHandlerInternal()
protected org.springframework.beans.factory.BeanFactory
getBeanFactory()
H
getObject()
java.lang.Class<? extends org.springframework.messaging.MessageHandler>
getObjectType()
protected java.lang.Class<? extends org.springframework.messaging.MessageHandler>
getPreCreationHandlerType()
Subclasses can override this to return a more specific type before handler creation.boolean
isSingleton()
void
setAdviceChain(java.util.List<org.aopalliance.aop.Advice> adviceChain)
Set the advice chain to be configured within anAbstractReplyProducingMessageHandler
to advise just this local endpoint.void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
void
setAsync(java.lang.Boolean async)
Currently only exposed on the service activator namespace.void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setBeanName(java.lang.String beanName)
void
setChannelResolver(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)
Set the handler's channel resolver.void
setComponentName(java.lang.String componentName)
Sets the name of the handler component.void
setOrder(java.lang.Integer order)
Set the order in which the handler will be subscribed to its channel (when subscribable).void
setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)
Set the handler's output channel.void
setOutputChannelName(java.lang.String outputChannelName)
Set the handler's output channel name.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
AbstractSimpleMessageHandlerFactoryBean
public AbstractSimpleMessageHandlerFactoryBean()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
setBeanName
public void setBeanName(java.lang.String beanName)- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)- Specified by:
setApplicationEventPublisher
in interfaceorg.springframework.context.ApplicationEventPublisherAware
-
setChannelResolver
public void setChannelResolver(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)Set the handler's channel resolver.- Parameters:
channelResolver
- the channel resolver to set.
-
setOutputChannel
public void setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)Set the handler's output channel.- Parameters:
outputChannel
- the output channel to set.
-
setOutputChannelName
public void setOutputChannelName(java.lang.String outputChannelName)Set the handler's output channel name.- Parameters:
outputChannelName
- the output channel bean name to set.- Since:
- 5.1.4
-
setOrder
public void setOrder(java.lang.Integer order)Set the order in which the handler will be subscribed to its channel (when subscribable).- Parameters:
order
- the order to set.
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
getBeanFactory
protected org.springframework.beans.factory.BeanFactory getBeanFactory() -
setAdviceChain
public void setAdviceChain(java.util.List<org.aopalliance.aop.Advice> adviceChain)Set the advice chain to be configured within anAbstractReplyProducingMessageHandler
to advise just this local endpoint. For other handlers, the advice chain is applied around the handler itself.- Parameters:
adviceChain
- the adviceChain to set.
-
setAsync
public void setAsync(java.lang.Boolean async)Currently only exposed on the service activator namespace. It's not clear that other endpoints would benefit from async support, but any subclass ofAbstractReplyProducingMessageHandler
can potentially return aListenableFuture<?>
.- Parameters:
async
- the async to set.- Since:
- 4.3
-
setComponentName
public void setComponentName(java.lang.String componentName)Sets the name of the handler component.- Parameters:
componentName
- The component name.
-
getObject
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>
-
createHandlerInternal
-
createHandler
-
getObjectType
public java.lang.Class<? extends org.springframework.messaging.MessageHandler> getObjectType()- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>
-
getPreCreationHandlerType
protected java.lang.Class<? extends org.springframework.messaging.MessageHandler> getPreCreationHandlerType()Subclasses can override this to return a more specific type before handler creation. After handler creation, the actual type is used.- Returns:
- the type.
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>
-