public abstract class AbstractConnectionFactory extends java.lang.Object implements ConnectionFactory, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>
| Modifier and Type | Field and Description | 
|---|---|
| static int | DEFAULT_CLOSE_TIMEOUT | 
| protected org.apache.commons.logging.Log | logger | 
| Constructor and Description | 
|---|
| AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)Create a new AbstractConnectionFactory for the given target ConnectionFactory,
 with no publisher connection factory. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addChannelListener(ChannelListener listener) | 
| void | addConnectionListener(ConnectionListener listener) | 
| void | clearConnectionListeners() | 
| protected Connection | createBareConnection() | 
| void | destroy() | 
| protected org.springframework.context.ApplicationContext | getApplicationContext() | 
| protected org.springframework.context.ApplicationEventPublisher | getApplicationEventPublisher() | 
| protected java.lang.String | getBeanName()Return a bean name of the component or null if not a bean. | 
| protected ChannelListener | getChannelListener()A composite channel listener to be used by subclasses when creating and closing channels. | 
| int | getCloseTimeout() | 
| protected ConnectionListener | getConnectionListener()A composite connection listener to be used by subclasses when creating and closing connections. | 
| protected boolean | getContextStopped() | 
| protected java.lang.String | getDefaultHostName() | 
| protected java.util.concurrent.ExecutorService | getExecutorService() | 
| java.lang.String | getHost() | 
| int | getPort() | 
| ConnectionFactory | getPublisherConnectionFactory()Return a separate connection factory for publishers (if implemented). | 
| com.rabbitmq.client.ConnectionFactory | getRabbitConnectionFactory()Return a reference to the underlying Rabbit Connection factory. | 
| java.lang.String | getUsername()Return the user name from the underlying rabbit connection factory. | 
| java.lang.String | getVirtualHost() | 
| boolean | hasPublisherConnectionFactory() | 
| void | onApplicationEvent(org.springframework.context.event.ContextClosedEvent event) | 
| boolean | removeConnectionListener(ConnectionListener listener) | 
| void | setAddresses(java.lang.String addresses)Set addresses for clustering. | 
| void | setApplicationContext(org.springframework.context.ApplicationContext applicationContext) | 
| void | setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) | 
| void | setBeanName(java.lang.String name) | 
| void | setChannelListeners(java.util.List<? extends ChannelListener> listeners) | 
| void | setCloseTimeout(int closeTimeout)How long to wait (milliseconds) for a response to a connection close
 operation from the broker; default 30000 (30 seconds). | 
| void | setConnectionListeners(java.util.List<? extends ConnectionListener> listeners) | 
| void | setConnectionNameStrategy(ConnectionNameStrategy connectionNameStrategy)Provide a  ConnectionNameStrategyto build the name for the target RabbitMQ connection. | 
| void | setConnectionThreadFactory(java.util.concurrent.ThreadFactory threadFactory)Set the  ThreadFactoryon the underlying rabbit connection factory. | 
| void | setConnectionTimeout(int connectionTimeout) | 
| void | setExecutor(java.util.concurrent.Executor executor)Provide an Executor for
 use by the Rabbit ConnectionFactory when creating connections. | 
| void | setHost(java.lang.String host) | 
| void | setPassword(java.lang.String password) | 
| void | setPort(int port) | 
| protected void | setPublisherConnectionFactory(AbstractConnectionFactory publisherConnectionFactory) | 
| void | setRecoveryListener(com.rabbitmq.client.RecoveryListener recoveryListener)Set a  RecoveryListenerthat will be added to each connection created. | 
| void | setRequestedHeartBeat(int requestedHeartBeat) | 
| void | setUri(java.lang.String uri) | 
| void | setUri(java.net.URI uri) | 
| void | setUsername(java.lang.String username) | 
| void | setVirtualHost(java.lang.String virtualHost) | 
| java.lang.String | toString() | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateConnection, isPublisherConfirms, isPublisherReturns, isSimplePublisherConfirmspublic static final int DEFAULT_CLOSE_TIMEOUT
protected final org.apache.commons.logging.Log logger
public AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory - the target ConnectionFactoryprotected final void setPublisherConnectionFactory(AbstractConnectionFactory publisherConnectionFactory)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareprotected org.springframework.context.ApplicationContext getApplicationContext()
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwareprotected org.springframework.context.ApplicationEventPublisher getApplicationEventPublisher()
public void onApplicationEvent(org.springframework.context.event.ContextClosedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>protected boolean getContextStopped()
public com.rabbitmq.client.ConnectionFactory getRabbitConnectionFactory()
public java.lang.String getUsername()
getUsername in interface ConnectionFactorypublic void setUsername(java.lang.String username)
public void setPassword(java.lang.String password)
public void setHost(java.lang.String host)
public void setConnectionThreadFactory(java.util.concurrent.ThreadFactory threadFactory)
ThreadFactory on the underlying rabbit connection factory.threadFactory - the thread factory.public void setUri(java.net.URI uri)
uri - the URIConnectionFactory.setUri(URI)public void setUri(java.lang.String uri)
uri - the URIConnectionFactory.setUri(String)public java.lang.String getHost()
getHost in interface ConnectionFactorypublic void setVirtualHost(java.lang.String virtualHost)
public java.lang.String getVirtualHost()
getVirtualHost in interface ConnectionFactorypublic void setPort(int port)
public void setRequestedHeartBeat(int requestedHeartBeat)
public void setConnectionTimeout(int connectionTimeout)
public int getPort()
getPort in interface ConnectionFactorypublic void setAddresses(java.lang.String addresses)
addresses - list of addresses with form "host[:port],..."protected ConnectionListener getConnectionListener()
protected ChannelListener getChannelListener()
public void setConnectionListeners(java.util.List<? extends ConnectionListener> listeners)
public void addConnectionListener(ConnectionListener listener)
addConnectionListener in interface ConnectionFactorypublic boolean removeConnectionListener(ConnectionListener listener)
removeConnectionListener in interface ConnectionFactorypublic void clearConnectionListeners()
clearConnectionListeners in interface ConnectionFactorypublic void setChannelListeners(java.util.List<? extends ChannelListener> listeners)
public void setRecoveryListener(com.rabbitmq.client.RecoveryListener recoveryListener)
RecoveryListener that will be added to each connection created.recoveryListener - the listener.public void addChannelListener(ChannelListener listener)
public void setExecutor(java.util.concurrent.Executor executor)
executor - The executor.protected java.util.concurrent.ExecutorService getExecutorService()
public void setCloseTimeout(int closeTimeout)
closeTimeout - the closeTimeout to set.public int getCloseTimeout()
public void setConnectionNameStrategy(ConnectionNameStrategy connectionNameStrategy)
ConnectionNameStrategy to build the name for the target RabbitMQ connection.
 The beanName together with a counter is used by default.connectionNameStrategy - the ConnectionNameStrategy to use.public void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwareprotected java.lang.String getBeanName()
public boolean hasPublisherConnectionFactory()
public ConnectionFactory getPublisherConnectionFactory()
ConnectionFactorygetPublisherConnectionFactory in interface ConnectionFactoryprotected final Connection createBareConnection()
protected final java.lang.String getDefaultHostName()
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanpublic java.lang.String toString()
toString in class java.lang.Object