public abstract class AbstractConnectionFactory extends Object implements ConnectionFactory, DisposableBean
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 SingleConnectionFactory for the given target ConnectionFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelListener(ChannelListener listener) |
void |
addConnectionListener(ConnectionListener listener) |
protected Connection |
createBareConnection() |
void |
destroy() |
protected ChannelListener |
getChannelListener()
A composite channel listener to be used by subclasses when creating and closing channels.
|
protected ConnectionListener |
getConnectionListener()
A composite connection listener to be used by subclasses when creating and closing connections.
|
protected String |
getDefaultHostName() |
String |
getHost() |
int |
getPort() |
String |
getVirtualHost() |
void |
setAddresses(String addresses)
Set addresses for clustering.
|
void |
setChannelListeners(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(List<? extends ConnectionListener> listeners) |
void |
setExecutor(Executor executor)
Provide an Executor for
use by the Rabbit ConnectionFactory when creating connections.
|
void |
setHost(String host) |
void |
setPassword(String password) |
void |
setPort(int port) |
void |
setRequestedHeartBeat(int requestedHeartBeat) |
void |
setUsername(String username) |
void |
setVirtualHost(String virtualHost) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createConnection
protected final org.apache.commons.logging.Log logger
public static final int DEFAULT_CLOSE_TIMEOUT
public AbstractConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory
- the target ConnectionFactorypublic void setUsername(String username)
public void setPassword(String password)
public void setHost(String host)
public String getHost()
getHost
in interface ConnectionFactory
public void setVirtualHost(String virtualHost)
public String getVirtualHost()
getVirtualHost
in interface ConnectionFactory
public void setPort(int port)
public void setRequestedHeartBeat(int requestedHeartBeat)
public int getPort()
getPort
in interface ConnectionFactory
public void setAddresses(String addresses)
addresses
- list of addresses with form "host[:port],..."protected ConnectionListener getConnectionListener()
protected ChannelListener getChannelListener()
public void setConnectionListeners(List<? extends ConnectionListener> listeners)
public void addConnectionListener(ConnectionListener listener)
addConnectionListener
in interface ConnectionFactory
public void setChannelListeners(List<? extends ChannelListener> listeners)
public void addChannelListener(ChannelListener listener)
public void setExecutor(Executor executor)
executor
- The executor.public void setCloseTimeout(int closeTimeout)
closeTimeout
- the closeTimeout to set.protected final Connection createBareConnection()
protected final String getDefaultHostName()
public void destroy()
destroy
in interface DisposableBean