Package org.springframework.jms.config
Class JmsListenerEndpointRegistrar
- java.lang.Object
- org.springframework.jms.config.JmsListenerEndpointRegistrar
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
public class JmsListenerEndpointRegistrar extends Object implements BeanFactoryAware, InitializingBean
Helper bean for registeringJmsListenerEndpoint
with aJmsListenerEndpointRegistry
.- Since:
- 4.1
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
JmsListenerConfigurer
Constructor Summary
Constructors Constructor Description JmsListenerEndpointRegistrar()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.JmsListenerEndpointRegistry
getEndpointRegistry()
Return theJmsListenerEndpointRegistry
instance for this registrar, may benull
.MessageHandlerMethodFactory
getMessageHandlerMethodFactory()
Return the customMessageHandlerMethodFactory
to use, if any.protected void
registerAllEndpoints()
void
registerEndpoint(JmsListenerEndpoint endpoint)
Register a newJmsListenerEndpoint
using the defaultJmsListenerContainerFactory
to create the underlying container.void
registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory)
Register a newJmsListenerEndpoint
alongside theJmsListenerContainerFactory
to use to create the underlying container.void
setBeanFactory(BeanFactory beanFactory)
ABeanFactory
only needs to be available in conjunction withsetContainerFactoryBeanName(java.lang.String)
.void
setContainerFactory(JmsListenerContainerFactory<?> containerFactory)
Set theJmsListenerContainerFactory
to use in case aJmsListenerEndpoint
is registered with anull
container factory.void
setContainerFactoryBeanName(String containerFactoryBeanName)
Set the bean name of theJmsListenerContainerFactory
to use in case aJmsListenerEndpoint
is registered with anull
container factory.void
setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry)
Set theJmsListenerEndpointRegistry
instance to use.void
setMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory)
Set theMessageHandlerMethodFactory
to use to configure the message listener responsible to serve an endpoint detected by this processor.
Constructor Detail
JmsListenerEndpointRegistrar
public JmsListenerEndpointRegistrar()
Method Detail
setEndpointRegistry
public void setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry)
Set theJmsListenerEndpointRegistry
instance to use.
getEndpointRegistry
public JmsListenerEndpointRegistry getEndpointRegistry()
Return theJmsListenerEndpointRegistry
instance for this registrar, may benull
.
setMessageHandlerMethodFactory
public void setMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory)
Set theMessageHandlerMethodFactory
to use to configure the message listener responsible to serve an endpoint detected by this processor.By default,
DefaultMessageHandlerMethodFactory
is used and it can be configured further to support additional method arguments or to customize conversion and validation support. SeeDefaultMessageHandlerMethodFactory
javadoc for more details.
getMessageHandlerMethodFactory
public MessageHandlerMethodFactory getMessageHandlerMethodFactory()
Return the customMessageHandlerMethodFactory
to use, if any.
setContainerFactory
public void setContainerFactory(JmsListenerContainerFactory<?> containerFactory)
Set theJmsListenerContainerFactory
to use in case aJmsListenerEndpoint
is registered with anull
container factory.Alternatively, the bean name of the
JmsListenerContainerFactory
to use can be specified for a lazy lookup, seesetContainerFactoryBeanName(java.lang.String)
.
setContainerFactoryBeanName
public void setContainerFactoryBeanName(String containerFactoryBeanName)
Set the bean name of theJmsListenerContainerFactory
to use in case aJmsListenerEndpoint
is registered with anull
container factory. Alternatively, the container factory instance can be registered directly: seesetContainerFactory(JmsListenerContainerFactory)
.
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
ABeanFactory
only needs to be available in conjunction withsetContainerFactoryBeanName(java.lang.String)
.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
BeanInitializationException
afterPropertiesSet
public void afterPropertiesSet()
Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
registerAllEndpoints
protected void registerAllEndpoints()
registerEndpoint
public void registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory)
Register a newJmsListenerEndpoint
alongside theJmsListenerContainerFactory
to use to create the underlying container.The
factory
may benull
if the default factory has to be used for that endpoint.
registerEndpoint
public void registerEndpoint(JmsListenerEndpoint endpoint)
Register a newJmsListenerEndpoint
using the defaultJmsListenerContainerFactory
to create the underlying container.