|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.amqp.rabbit.connection.AbstractConnectionFactory
org.springframework.amqp.rabbit.connection.SingleConnectionFactory
public class SingleConnectionFactory
A ConnectionFactory implementation that returns the same Connections from all createConnection()
calls, and ignores calls to Connection.close().
| Field Summary |
|---|
| Fields inherited from class org.springframework.amqp.rabbit.connection.AbstractConnectionFactory |
|---|
logger |
| Constructor Summary | |
|---|---|
SingleConnectionFactory()
Create a new SingleConnectionFactory initializing the hostname to be the value returned from InetAddress.getLocalHost(), or "localhost" if getLocalHost() throws an exception. |
|
SingleConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
Create a new SingleConnectionFactory for the given target ConnectionFactory. |
|
SingleConnectionFactory(int port)
Create a new SingleConnectionFactory given a host name. |
|
SingleConnectionFactory(java.lang.String hostname)
Create a new SingleConnectionFactory given a host name. |
|
SingleConnectionFactory(java.lang.String hostname,
int port)
Create a new SingleConnectionFactory given a host name. |
|
| Method Summary | |
|---|---|
void |
addConnectionListener(ConnectionListener listener)
|
Connection |
createConnection()
|
void |
destroy()
Close the underlying shared connection. |
protected Connection |
doCreateConnection()
Create a Connection. |
void |
setConnectionListeners(java.util.List<? extends ConnectionListener> listeners)
|
java.lang.String |
toString()
|
| Methods inherited from class org.springframework.amqp.rabbit.connection.AbstractConnectionFactory |
|---|
addChannelListener, createBareConnection, getChannelListener, getConnectionListener, getDefaultHostName, getHost, getPort, getVirtualHost, setChannelListeners, setHost, setPassword, setPort, setUsername, setVirtualHost |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SingleConnectionFactory()
public SingleConnectionFactory(int port)
port - the port to connect topublic SingleConnectionFactory(java.lang.String hostname)
hostname - the host name to connect to
public SingleConnectionFactory(java.lang.String hostname,
int port)
hostname - the host name to connect toport - the port number to connect topublic SingleConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory - the target ConnectionFactory| Method Detail |
|---|
public void setConnectionListeners(java.util.List<? extends ConnectionListener> listeners)
setConnectionListeners in class AbstractConnectionFactorypublic void addConnectionListener(ConnectionListener listener)
addConnectionListener in interface ConnectionFactoryaddConnectionListener in class AbstractConnectionFactory
public final Connection createConnection()
throws AmqpException
AmqpExceptionpublic final void destroy()
As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.
destroy in interface org.springframework.beans.factory.DisposableBeandestroy in class AbstractConnectionFactoryprotected Connection doCreateConnection()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||