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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.Return theJmsListenerEndpointRegistry
instance for this registrar, may benull
.Return the customMessageHandlerMethodFactory
to use, if any.protected void
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 Details
-
JmsListenerEndpointRegistrar
public JmsListenerEndpointRegistrar()
-
-
Method Details
-
setEndpointRegistry
Set theJmsListenerEndpointRegistry
instance to use. -
getEndpointRegistry
Return theJmsListenerEndpointRegistry
instance for this registrar, may benull
. -
setMessageHandlerMethodFactory
public void setMessageHandlerMethodFactory(@Nullable 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
Return the customMessageHandlerMethodFactory
to use, if any. -
setContainerFactory
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
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
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:
-
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, @Nullable JmsListenerContainerFactory<?> factory) Register a newJmsListenerEndpoint
alongside theJmsListenerContainerFactory
to use to create the underlying container.The
factory
may benull
if the default factory should be used for the supplied endpoint. -
registerEndpoint
Register a newJmsListenerEndpoint
using the defaultJmsListenerContainerFactory
to create the underlying container.
-