|
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().
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
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(String hostname)
Create a new SingleConnectionFactory given a host name. |
|
| Method Summary | |
|---|---|
protected void |
closeConnection(com.rabbitmq.client.Connection connection)
Close the given Connection. |
com.rabbitmq.client.Connection |
createConnection()
|
void |
destroy()
Close the underlying shared connection. |
protected com.rabbitmq.client.Connection |
doCreateConnection()
Create a Rabbit Connection via this class's ConnectionFactory. |
protected com.rabbitmq.client.Channel |
getChannel(com.rabbitmq.client.Connection connection)
|
String |
getHost()
|
protected int |
getPort()
|
protected com.rabbitmq.client.Connection |
getSharedConnectionProxy(com.rabbitmq.client.Connection target)
Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls. |
String |
getVirtualHost()
|
void |
initConnection()
|
protected void |
prepareConnection(com.rabbitmq.client.Connection con)
|
void |
resetConnection()
Reset the underlying shared Connection, to be reinitialized on next access. |
void |
setPassword(String password)
|
void |
setPort(int port)
|
void |
setUsername(String username)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public SingleConnectionFactory()
public SingleConnectionFactory(String hostname)
hostName - the host name to connect topublic SingleConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory - the target ConnectionFactoryhostName - the host name to connect to| Method Detail |
|---|
public void setUsername(String username)
public void setPassword(String password)
public String getHost()
getHost in interface ConnectionFactorypublic String getVirtualHost()
getVirtualHost in interface ConnectionFactorypublic void setPort(int port)
protected int getPort()
protected com.rabbitmq.client.Channel getChannel(com.rabbitmq.client.Connection connection)
throws Exception
Exception
public com.rabbitmq.client.Connection createConnection()
throws IOException
createConnection in interface ConnectionFactoryIOException
public void initConnection()
throws IOException
IOExceptionpublic void destroy()
As this bean implements DisposableBean, a bean factory will automatically invoke this on destruction of its cached singletons.
destroy in interface DisposableBeanpublic void resetConnection()
protected void closeConnection(com.rabbitmq.client.Connection connection)
connection - the Connection to close
protected com.rabbitmq.client.Connection doCreateConnection()
throws IOException
IOException
protected void prepareConnection(com.rabbitmq.client.Connection con)
throws IOException
IOExceptionprotected com.rabbitmq.client.Connection getSharedConnectionProxy(com.rabbitmq.client.Connection target)
target - the original Connection to wrap
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 | |||||||||