public abstract class AbstractConnectionFactory extends Object implements ConnectionFactory, DisposableBean, BeanNameAware
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelListener(ChannelListener listener) |
void |
addConnectionListener(ConnectionListener listener) |
void |
clearConnectionListeners() |
protected Connection |
createBareConnection() |
void |
destroy() |
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 String |
getDefaultHostName() |
protected ExecutorService |
getExecutorService() |
String |
getHost() |
int |
getPort() |
com.rabbitmq.client.ConnectionFactory |
getRabbitConnectionFactory()
Return a reference to the underlying Rabbit Connection factory.
|
String |
getUsername()
Return the user name from the unerlying rabbit connection factory.
|
String |
getVirtualHost() |
boolean |
removeConnectionListener(ConnectionListener listener) |
void |
setAddresses(String addresses)
Set addresses for clustering.
|
void |
setBeanName(String name) |
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 |
setConnectionThreadFactory(ThreadFactory threadFactory)
Set the
ThreadFactory on the underlying rabbit connection factory. |
void |
setConnectionTimeout(int connectionTimeout) |
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 |
setUri(String uri) |
void |
setUri(URI uri) |
void |
setUsername(String username) |
void |
setVirtualHost(String virtualHost) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 com.rabbitmq.client.ConnectionFactory getRabbitConnectionFactory()
public String getUsername()
getUsername
in interface ConnectionFactory
public void setUsername(String username)
public void setPassword(String password)
public void setHost(String host)
public void setConnectionThreadFactory(ThreadFactory threadFactory)
ThreadFactory
on the underlying rabbit connection factory.
Not exposed using XML configuration; define a bean for the Rabbit CF and
provide it to the Spring CF using the connection-factory
attribute.
TODO: remove this comment when AMQP-554 is resolved.threadFactory
- the thread factory.public void setUri(URI uri)
uri
- the URIConnectionFactory.setUri(URI)
public void setUri(String uri)
uri
- the URIConnectionFactory.setUri(String)
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 void setConnectionTimeout(int connectionTimeout)
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 boolean removeConnectionListener(ConnectionListener listener)
removeConnectionListener
in interface ConnectionFactory
public void clearConnectionListeners()
clearConnectionListeners
in interface ConnectionFactory
public void setChannelListeners(List<? extends ChannelListener> listeners)
public void addChannelListener(ChannelListener listener)
public void setExecutor(Executor executor)
executor
- The executor.protected ExecutorService getExecutorService()
public void setCloseTimeout(int closeTimeout)
closeTimeout
- the closeTimeout to set.public int getCloseTimeout()
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
protected final Connection createBareConnection()
protected final String getDefaultHostName()
public void destroy()
destroy
in interface DisposableBean