Spring Integration

org.springframework.integration.amqp.config
Class AmqpChannelFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
      extended by org.springframework.integration.amqp.config.AmqpChannelFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<AbstractAmqpChannel>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class AmqpChannelFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
implements org.springframework.context.SmartLifecycle, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanNameAware

If point-to-point, we send to the default exchange with the routing key equal to "[beanName]" and we declare that same Queue and register a listener if message-driven or poll explicitly otherwise. If publish-subscribe, we declare a FanoutExchange named "si.fanout.[beanName]" and we send to that without any routing key, and on the receiving side, we create an anonymous Queue that is bound to that exchange.

Since:
2.1
Author:
Mark Fisher, Gary Russell

Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
AmqpChannelFactoryBean()
           
AmqpChannelFactoryBean(boolean messageDriven)
           
 
Method Summary
protected  AbstractAmqpChannel createInstance()
           
protected  void destroyInstance(AbstractAmqpChannel instance)
           
 java.lang.Class<?> getObjectType()
           
 int getPhase()
           
 boolean isAutoStartup()
           
 boolean isRunning()
           
 void setAcknowledgeMode(org.springframework.amqp.core.AcknowledgeMode acknowledgeMode)
           
 void setAdviceChain(org.aopalliance.aop.Advice[] adviceChain)
           
 void setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
          This is an optional reference to an AmqpAdmin to use when declaring a Queue implicitly for a PollableAmqpChannel.
 void setAutoStartup(boolean autoStartup)
           
 void setBeanName(java.lang.String name)
           
 void setChannelTransacted(boolean channelTransacted)
           
 void setConcurrentConsumers(int concurrentConsumers)
           
 void setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
           
 void setEncoding(java.lang.String encoding)
           
 void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
           
 void setExchange(org.springframework.amqp.core.FanoutExchange exchange)
          Set the FanoutExchange to use.
 void setExposeListenerChannel(boolean exposeListenerChannel)
           
 void setInterceptors(java.util.List<ChannelInterceptor> interceptors)
           
 void setMaxSubscribers(int maxSubscribers)
           
 void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
           
 void setMessagePropertiesConverter(org.springframework.amqp.rabbit.support.MessagePropertiesConverter messagePropertiesConverter)
           
 void setPhase(int phase)
           
 void setPrefetchCount(int prefetchCount)
           
 void setPubSub(boolean pubSub)
           
 void setQueueName(java.lang.String queueName)
          Set the Queue name to use.
 void setReceiveTimeout(long receiveTimeout)
           
 void setRecoveryInterval(long recoveryInterval)
           
 void setShutdownTimeout(long shutdownTimeout)
           
 void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
           
 void setTransactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)
           
 void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
           
 void setTxSize(int txSize)
           
 void start()
           
 void stop()
           
 void stop(java.lang.Runnable callback)
           
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
 

Constructor Detail

AmqpChannelFactoryBean

public AmqpChannelFactoryBean()

AmqpChannelFactoryBean

public AmqpChannelFactoryBean(boolean messageDriven)
Method Detail

setBeanName

public void setBeanName(java.lang.String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

setInterceptors

public void setInterceptors(java.util.List<ChannelInterceptor> interceptors)

setAmqpAdmin

public void setAmqpAdmin(org.springframework.amqp.core.AmqpAdmin amqpAdmin)
This is an optional reference to an AmqpAdmin to use when declaring a Queue implicitly for a PollableAmqpChannel. It is not needed for the message-driven (Subscribable) channels since those are able to create a RabbitAdmin instance using the underlying listener container's ConnectionFactory.


setExchange

public void setExchange(org.springframework.amqp.core.FanoutExchange exchange)
Set the FanoutExchange to use. This is only relevant for publish-subscribe-channels, and even then if not provided, a FanoutExchange will be implicitly created.


setQueueName

public void setQueueName(java.lang.String queueName)
Set the Queue name to use. This is only relevant for point-to-point channels, even then if not provided, a Queue will be implicitly created.


setEncoding

public void setEncoding(java.lang.String encoding)

setMessageConverter

public void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)

setChannelTransacted

public void setChannelTransacted(boolean channelTransacted)

setConnectionFactory

public void setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)

setMessagePropertiesConverter

public void setMessagePropertiesConverter(org.springframework.amqp.rabbit.support.MessagePropertiesConverter messagePropertiesConverter)

setAcknowledgeMode

public void setAcknowledgeMode(org.springframework.amqp.core.AcknowledgeMode acknowledgeMode)

setAdviceChain

public void setAdviceChain(org.aopalliance.aop.Advice[] adviceChain)

setAutoStartup

public void setAutoStartup(boolean autoStartup)

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)

setErrorHandler

public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)

setExposeListenerChannel

public void setExposeListenerChannel(boolean exposeListenerChannel)

setPhase

public void setPhase(int phase)

setPrefetchCount

public void setPrefetchCount(int prefetchCount)

setPubSub

public void setPubSub(boolean pubSub)

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)

setRecoveryInterval

public void setRecoveryInterval(long recoveryInterval)

setShutdownTimeout

public void setShutdownTimeout(long shutdownTimeout)

setTaskExecutor

public void setTaskExecutor(java.util.concurrent.Executor taskExecutor)

setTransactionAttribute

public void setTransactionAttribute(org.springframework.transaction.interceptor.TransactionAttribute transactionAttribute)

setTransactionManager

public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)

setTxSize

public void setTxSize(int txSize)

setMaxSubscribers

public void setMaxSubscribers(int maxSubscribers)

getObjectType

public java.lang.Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<AbstractAmqpChannel>
Specified by:
getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>

createInstance

protected AbstractAmqpChannel createInstance()
                                      throws java.lang.Exception
Specified by:
createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
Throws:
java.lang.Exception

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface org.springframework.context.SmartLifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface org.springframework.context.Phased

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle

start

public void start()
Specified by:
start in interface org.springframework.context.Lifecycle

stop

public void stop()
Specified by:
stop in interface org.springframework.context.Lifecycle

stop

public void stop(java.lang.Runnable callback)
Specified by:
stop in interface org.springframework.context.SmartLifecycle

destroyInstance

protected void destroyInstance(AbstractAmqpChannel instance)
                        throws java.lang.Exception
Overrides:
destroyInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<AbstractAmqpChannel>
Throws:
java.lang.Exception

Spring Integration