org.axonframework.eventhandling.amqp.spring
Class ListenerContainerFactory

java.lang.Object
  extended by org.axonframework.eventhandling.amqp.spring.ListenerContainerFactory
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
ListenerContainerLifecycleManager

public class ListenerContainerFactory
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

Factory for SimpleMessageListenerContainer beans. All properties available on the SimpleMessageListenerContainer are available on the factory. When createContainer(SpringAMQPConsumerConfiguration) is invoked, a new instance of SimpleMessageListenerContainer is created and configured with the properties set on this factory. For more information about the setters in this class and their default values, revert to the documentation of the SimpleMessageListenerContainer

This class is not thread-safe and is meant to be used in a Spring Application Context.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
ListenerContainerFactory()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer createContainer(SpringAMQPConsumerConfiguration config)
          Creates a new SimpleMessageListenerContainer, initialized with the properties set on this factory.
protected  org.springframework.context.ApplicationContext getApplicationContext()
          Returns the application context in which this bean is defined.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
          Sets the connection factory to use for the cluster
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerContainerFactory

public ListenerContainerFactory()
Method Detail

createContainer

public org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer createContainer(SpringAMQPConsumerConfiguration config)
Creates a new SimpleMessageListenerContainer, initialized with the properties set on this factory.

Parameters:
config - The container-specific configuration for the new container
Returns:
a fully initialized (but not started!) SimpleMessageListenerContainer instance.

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getApplicationContext

protected org.springframework.context.ApplicationContext getApplicationContext()
Returns the application context in which this bean is defined.

Returns:
the application context in which this bean is defined.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

setConnectionFactory

public void setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
Sets the connection factory to use for the cluster

Parameters:
connectionFactory - the connection factory to set
See Also:
RabbitAccessor.setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory)


Copyright © 2010-2016. All Rights Reserved.