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:
BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<AbstractAmqpChannel>, InitializingBean, Lifecycle, Phased, SmartLifecycle

public class AmqpChannelFactoryBean
extends AbstractFactoryBean<AbstractAmqpChannel>
implements SmartLifecycle, DisposableBean, BeanNameAware

If point-to-point, we send to the default exchange with the routing key equal to "si.[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

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 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(ErrorHandler errorHandler)
           
 void setExposeListenerChannel(boolean exposeListenerChannel)
           
 void setInterceptors(java.util.List<ChannelInterceptor> interceptors)
           
 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 setReceiveTimeout(long receiveTimeout)
           
 void setRecoveryInterval(long recoveryInterval)
           
 void setShutdownTimeout(long shutdownTimeout)
           
 void setTaskExecutor(java.util.concurrent.Executor taskExecutor)
           
 void setTransactionAttribute(TransactionAttribute transactionAttribute)
           
 void setTransactionManager(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 BeanNameAware

setInterceptors

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

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(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(TransactionAttribute transactionAttribute)

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)

setTxSize

public void setTxSize(int txSize)

getObjectType

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

createInstance

protected AbstractAmqpChannel createInstance()
                                      throws java.lang.Exception
Specified by:
createInstance in class AbstractFactoryBean<AbstractAmqpChannel>
Throws:
java.lang.Exception

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface SmartLifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface Phased

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

stop

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

destroyInstance

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