|
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(Connection connection)
Close the given Connection. |
Connection |
createConnection()
|
void |
destroy()
Close the underlying shared connection. |
protected Connection |
doCreateConnection()
Create a Rabbit Connection via this class's ConnectionFactory. |
protected com.rabbitmq.client.Channel |
getChannel(Connection connection,
boolean transactional)
|
String |
getHost()
|
protected int |
getPort()
|
protected Connection |
getSharedConnectionProxy(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(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)
|
void |
setVirtualHost(String virtualHost)
|
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 ConnectionFactory| Method Detail |
|---|
public void setUsername(String username)
public void setPassword(String password)
public String getHost()
getHost in interface ConnectionFactorypublic void setVirtualHost(String virtualHost)
public String getVirtualHost()
getVirtualHost in interface ConnectionFactorypublic void setPort(int port)
protected int getPort()
protected com.rabbitmq.client.Channel getChannel(Connection connection,
boolean transactional)
throws IOException
IOException
public 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(Connection connection)
connection - the Connection to close
protected Connection doCreateConnection()
throws IOException
IOException
protected void prepareConnection(Connection con)
throws IOException
IOExceptionprotected Connection getSharedConnectionProxy(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 | |||||||||