|
Spring AMQP | |||||||||
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(String hostname)
Create a new SingleConnectionFactory given a host name. |
|
SingleConnectionFactory(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(List<? extends ConnectionListener> listeners)
|
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(String hostname)
hostname
- the host name to connect topublic SingleConnectionFactory(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 ConnectionFactoryMethod Detail |
---|
public void setConnectionListeners(List<? extends ConnectionListener> listeners)
setConnectionListeners
in class AbstractConnectionFactory
public void addConnectionListener(ConnectionListener listener)
addConnectionListener
in interface ConnectionFactory
addConnectionListener
in class AbstractConnectionFactory
public final Connection createConnection() throws AmqpException
AmqpException
public final void destroy()
As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.
destroy
in interface DisposableBean
destroy
in class AbstractConnectionFactory
protected Connection doCreateConnection()
public String toString()
toString
in class Object
|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |