org.springframework.amqp.rabbit.connection
Class AbstractConnectionFactory
java.lang.Object
org.springframework.amqp.rabbit.connection.AbstractConnectionFactory
- All Implemented Interfaces:
- ConnectionFactory, org.springframework.beans.factory.DisposableBean
- Direct Known Subclasses:
- CachingConnectionFactory
public abstract class AbstractConnectionFactory
- extends java.lang.Object
- implements ConnectionFactory, org.springframework.beans.factory.DisposableBean
- Author:
- Dave Syer, Gary Russell
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary |
AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
Create a new SingleConnectionFactory for the given target ConnectionFactory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
AbstractConnectionFactory
public AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
- Create a new SingleConnectionFactory for the given target ConnectionFactory.
- Parameters:
rabbitConnectionFactory
- the target ConnectionFactory
setUsername
public void setUsername(java.lang.String username)
setPassword
public void setPassword(java.lang.String password)
setHost
public void setHost(java.lang.String host)
getHost
public java.lang.String getHost()
- Specified by:
getHost
in interface ConnectionFactory
setVirtualHost
public void setVirtualHost(java.lang.String virtualHost)
getVirtualHost
public java.lang.String getVirtualHost()
- Specified by:
getVirtualHost
in interface ConnectionFactory
setPort
public void setPort(int port)
getPort
public int getPort()
- Specified by:
getPort
in interface ConnectionFactory
setAddresses
public void setAddresses(java.lang.String addresses)
- Set addresses for clustering.
- Parameters:
addresses
- list of addresses with form "host[:port],..."
getConnectionListener
protected ConnectionListener getConnectionListener()
- A composite connection listener to be used by subclasses when creating and closing connections.
- Returns:
- the connection listener
getChannelListener
protected ChannelListener getChannelListener()
- A composite channel listener to be used by subclasses when creating and closing channels.
- Returns:
- the channel listener
setConnectionListeners
public void setConnectionListeners(java.util.List<? extends ConnectionListener> listeners)
addConnectionListener
public void addConnectionListener(ConnectionListener listener)
- Specified by:
addConnectionListener
in interface ConnectionFactory
setChannelListeners
public void setChannelListeners(java.util.List<? extends ChannelListener> listeners)
addChannelListener
public void addChannelListener(ChannelListener listener)
setExecutor
public void setExecutor(java.util.concurrent.Executor executor)
- Provide an Executor for
use by the Rabbit ConnectionFactory when creating connections.
Can either be an ExecutorService or a Spring
ThreadPoolTaskExecutor, as defined by a <task:executor/> element.
- Parameters:
executor
- The executor.
createBareConnection
protected final Connection createBareConnection()
getDefaultHostName
protected final java.lang.String getDefaultHostName()
destroy
public void destroy()
- Specified by:
destroy
in interface org.springframework.beans.factory.DisposableBean