|
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.SingleConnectionFactory
public class SingleConnectionFactory
A ConnectionFactory
implementation that returns the same Connections from all createConnection()
calls, and ignores calls to Connection.close()
.
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(String hostname)
Create a new SingleConnectionFactory given a host name. |
Method Summary | |
---|---|
Connection |
createConnection()
|
void |
destroy()
Close the underlying shared connection. |
protected Connection |
doCreateConnection()
Create a Connection. |
String |
getHost()
|
int |
getPort()
|
String |
getVirtualHost()
|
protected void |
reset()
Default implementation does nothing. |
void |
setHost(String host)
|
void |
setPassword(String password)
|
void |
setPort(int port)
|
void |
setUsername(String username)
|
void |
setVirtualHost(String virtualHost)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SingleConnectionFactory()
public SingleConnectionFactory(String hostname)
hostname
- the host name to connect topublic SingleConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory
- the target ConnectionFactoryMethod Detail |
---|
public 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 int getPort()
getPort
in interface ConnectionFactory
public final Connection createConnection() throws IOException
createConnection
in interface ConnectionFactory
IOException
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
protected void reset()
destroy()
.
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 |