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 registering
JmsListenerEndpoint with a JmsListenerEndpointRegistry.- Since:
- 4.1
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.Return theJmsListenerEndpointRegistryinstance for this registrar, may benull.Return the customMessageHandlerMethodFactoryto use, if any.protected voidvoidregisterEndpoint(JmsListenerEndpoint endpoint) Register a newJmsListenerEndpointusing the defaultJmsListenerContainerFactoryto create the underlying container.voidregisterEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory) Register a newJmsListenerEndpointalongside theJmsListenerContainerFactoryto use to create the underlying container.voidsetBeanFactory(BeanFactory beanFactory) ABeanFactoryonly needs to be available in conjunction withsetContainerFactoryBeanName(java.lang.String).voidsetContainerFactory(JmsListenerContainerFactory<?> containerFactory) Set theJmsListenerContainerFactoryto use in case aJmsListenerEndpointis registered with anullcontainer factory.voidsetContainerFactoryBeanName(String containerFactoryBeanName) Set the bean name of theJmsListenerContainerFactoryto use in case aJmsListenerEndpointis registered with anullcontainer factory.voidsetEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry) Set theJmsListenerEndpointRegistryinstance to use.voidsetMessageHandlerMethodFactory(MessageHandlerMethodFactory messageHandlerMethodFactory) Set theMessageHandlerMethodFactoryto use to configure the message listener responsible to serve an endpoint detected by this processor.
-
Constructor Details
-
JmsListenerEndpointRegistrar
public JmsListenerEndpointRegistrar()
-
-
Method Details
-
setEndpointRegistry
Set theJmsListenerEndpointRegistryinstance to use. -
getEndpointRegistry
Return theJmsListenerEndpointRegistryinstance for this registrar, may benull. -
setMessageHandlerMethodFactory
public void setMessageHandlerMethodFactory(@Nullable MessageHandlerMethodFactory messageHandlerMethodFactory) Set theMessageHandlerMethodFactoryto use to configure the message listener responsible to serve an endpoint detected by this processor.By default,
DefaultMessageHandlerMethodFactoryis used and it can be configured further to support additional method arguments or to customize conversion and validation support. SeeDefaultMessageHandlerMethodFactoryjavadoc for more details. -
getMessageHandlerMethodFactory
Return the customMessageHandlerMethodFactoryto use, if any. -
setContainerFactory
Set theJmsListenerContainerFactoryto use in case aJmsListenerEndpointis registered with anullcontainer factory.Alternatively, the bean name of the
JmsListenerContainerFactoryto use can be specified for a lazy lookup, seesetContainerFactoryBeanName(java.lang.String). -
setContainerFactoryBeanName
Set the bean name of theJmsListenerContainerFactoryto use in case aJmsListenerEndpointis registered with anullcontainer factory. Alternatively, the container factory instance can be registered directly: seesetContainerFactory(JmsListenerContainerFactory). -
setBeanFactory
ABeanFactoryonly needs to be available in conjunction withsetContainerFactoryBeanName(java.lang.String).- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Parameters:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- See Also:
-
afterPropertiesSet
public void afterPropertiesSet()Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.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:
afterPropertiesSetin interfaceInitializingBean
-
registerAllEndpoints
protected void registerAllEndpoints() -
registerEndpoint
public void registerEndpoint(JmsListenerEndpoint endpoint, @Nullable JmsListenerContainerFactory<?> factory) Register a newJmsListenerEndpointalongside theJmsListenerContainerFactoryto use to create the underlying container.The
factorymay benullif the default factory has to be used for that endpoint. -
registerEndpoint
Register a newJmsListenerEndpointusing the defaultJmsListenerContainerFactoryto create the underlying container.
-