org.springframework.jms.config

## Class JmsListenerEndpointRegistrar

- java.lang.Object
- - org.springframework.jms.config.JmsListenerEndpointRegistrar

All Implemented Interfaces:
  org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

    public class JmsListenerEndpointRegistrar
    extends Object
    implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

Helper bean for registering `JmsListenerEndpoint` with a `JmsListenerEndpointRegistry`.

Since:
  4.1
Author:
  Stephane Nicoll, Juergen Hoeller
See Also:
  `JmsListenerConfigurer`

### Constructor Summary

Constructors
Constructor and Description
`JmsListenerEndpointRegistrar()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `afterPropertiesSet()`
`JmsListenerEndpointRegistry` `getEndpointRegistry()` Return the `JmsListenerEndpointRegistry` instance for this registrar, may be `null`.
`org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory` `getMessageHandlerMethodFactory()` Return the custom `MessageHandlerMethodFactory` to use, if any.
`protected void` `registerAllEndpoints()`
`void` `registerEndpoint(JmsListenerEndpoint endpoint)` Register a new `JmsListenerEndpoint` using the default `JmsListenerContainerFactory` to create the underlying container.
`void` `registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory)` Register a new `JmsListenerEndpoint` alongside the `JmsListenerContainerFactory` to use to create the underlying container.
`void` `setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)` A `BeanFactory` only needs to be available in conjunction with `setContainerFactoryBeanName(java.lang.String)`.
`void` `setContainerFactory(JmsListenerContainerFactory<?> containerFactory)` Set the `JmsListenerContainerFactory` to use in case a `JmsListenerEndpoint` is registered with a `null` container factory.
`void` `setContainerFactoryBeanName(String containerFactoryBeanName)` Set the bean name of the `JmsListenerContainerFactory` to use in case a `JmsListenerEndpoint` is registered with a `null` container factory.
`void` `setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry)` Set the `JmsListenerEndpointRegistry` instance to use.
`void` `setMessageHandlerMethodFactory(org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory messageHandlerMethodFactory)` Set the `MessageHandlerMethodFactory` to use to configure the message listener responsible to serve an endpoint detected by this processor.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JmsListenerEndpointRegistrar

    public JmsListenerEndpointRegistrar()

### Method Detail

#### setEndpointRegistry

    public void setEndpointRegistry(@Nullable
                                    JmsListenerEndpointRegistry endpointRegistry)

Set the `JmsListenerEndpointRegistry` instance to use.

#### getEndpointRegistry

    @Nullable
    public JmsListenerEndpointRegistry getEndpointRegistry()

Return the `JmsListenerEndpointRegistry` instance for this registrar, may be `null`.

#### setMessageHandlerMethodFactory

    public void setMessageHandlerMethodFactory(@Nullable
                                               org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory messageHandlerMethodFactory)

Set the `MessageHandlerMethodFactory` 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. See `DefaultMessageHandlerMethodFactory` javadoc for more details.

#### getMessageHandlerMethodFactory

    @Nullable
    public org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory getMessageHandlerMethodFactory()

Return the custom `MessageHandlerMethodFactory` to use, if any.

#### setContainerFactory

    public void setContainerFactory(JmsListenerContainerFactory<?> containerFactory)

Set the `JmsListenerContainerFactory` to use in case a `JmsListenerEndpoint` is registered with a `null` container factory.

Alternatively, the bean name of the `JmsListenerContainerFactory` to use can be specified for a lazy lookup, see `setContainerFactoryBeanName(java.lang.String)`.

#### setContainerFactoryBeanName

    public void setContainerFactoryBeanName(String containerFactoryBeanName)

Set the bean name of the `JmsListenerContainerFactory` to use in case a `JmsListenerEndpoint` is registered with a `null` container factory. Alternatively, the container factory instance can be registered directly: see `setContainerFactory(JmsListenerContainerFactory)`.

See Also:
  `setBeanFactory(org.springframework.beans.factory.BeanFactory)`

#### setBeanFactory

    public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)

A `BeanFactory` only needs to be available in conjunction with `setContainerFactoryBeanName(java.lang.String)`.

Specified by:
  `setBeanFactory` in interface `org.springframework.beans.factory.BeanFactoryAware`

#### afterPropertiesSet

    public void afterPropertiesSet()

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`

#### registerAllEndpoints

    protected void registerAllEndpoints()

#### registerEndpoint

    public void registerEndpoint(JmsListenerEndpoint endpoint,
                                 @Nullable
                                 JmsListenerContainerFactory<?> factory)

Register a new `JmsListenerEndpoint` alongside the `JmsListenerContainerFactory` to use to create the underlying container.

The `factory` may be `null` if the default factory has to be used for that endpoint.

#### registerEndpoint

    public void registerEndpoint(JmsListenerEndpoint endpoint)

Register a new `JmsListenerEndpoint` using the default `JmsListenerContainerFactory` to create the underlying container.

See Also:
  `setContainerFactory(JmsListenerContainerFactory)`, `registerEndpoint(JmsListenerEndpoint, JmsListenerContainerFactory)`