public class RabbitListenerEndpointRegistry extends Object implements DisposableBean, SmartLifecycle
MessageListenerContainer instances for the
registered endpoints. Also manages the
lifecycle of the listener containers, in particular within the lifecycle
of the application context.
Contrary to MessageListenerContainers created manually, listener
containers managed by registry are not beans in the application context and
are not candidates for autowiring. Use getListenerContainers() if
you need to access this registry's listener containers for management purposes.
If you need to access to a specific message listener container, use
getListenerContainer(String) with the id of the endpoint.
RabbitListenerEndpoint,
MessageListenerContainer,
RabbitListenerContainerFactory| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
RabbitListenerEndpointRegistry() |
public MessageListenerContainer getListenerContainer(String id)
MessageListenerContainer with the specified id or
null if no such container exists.id - the id of the containernull if no container with that id existsRabbitListenerEndpoint.getId()public Collection<MessageListenerContainer> getListenerContainers()
MessageListenerContainer instance(s).public void registerListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory)
RabbitListenerEndpoint.
This create the necessary infrastructure to honor that endpoint with regards to its configuration.
endpoint - the endpoint to addfactory - the listener factory to useregisterListenerContainer(RabbitListenerEndpoint, RabbitListenerContainerFactory, boolean)public void registerListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory, boolean startImmediately)
RabbitListenerEndpoint.
This create the necessary infrastructure to honor that endpoint with regards to its configuration.
The startImmediately flag determines if the container should be
started immediately.
endpoint - the endpoint to add.factory - the RabbitListenerContainerFactory to use.startImmediately - start the container immediately if necessarygetListenerContainers(),
getListenerContainer(String)protected MessageListenerContainer createListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory)
MessageListenerContainer using the specified factory.endpoint - the endpoint to create a MessageListenerContainer.factory - the RabbitListenerContainerFactory to use.MessageListenerContainer.public void destroy()
destroy in interface DisposableBeanpublic boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void stop(Runnable callback)
stop in interface SmartLifecycle