public class SimpleConnection extends java.lang.Object implements Connection, com.rabbitmq.client.impl.NetworkConnection
| Constructor and Description |
|---|
SimpleConnection(com.rabbitmq.client.Connection delegate,
int closeTimeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this connection and all its channels
with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
com.rabbitmq.client.Channel |
createChannel(boolean transactional)
Create a new channel, using an internally allocated channel number.
|
java.net.InetAddress |
getAddress() |
java.net.InetAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getPort() |
boolean |
isOpen()
True if the connection is open.
|
java.lang.String |
toString() |
public SimpleConnection(com.rabbitmq.client.Connection delegate,
int closeTimeout)
public com.rabbitmq.client.Channel createChannel(boolean transactional)
ConnectioncreateChannel in interface Connectiontransactional - true if the channel should support transactionspublic void close()
ConnectionAMQP.REPLY_SUCCESS close code
and message 'OK'.
Waits for all the close operations to complete.close in interface Connectionpublic boolean isOpen()
isOpen in interface ConnectionAutoRecoverConnectionNotCurrentlyOpenException - if the connection is an
AutorecoveringConnection and is currently closed; this is required to
prevent the CachingConnectionFactory from discarding this connection
and opening a new one, in which case the "old" connection would eventually be recovered
and orphaned - also any consumers belonging to it might be recovered too
and the broker will deliver messages to them when there is no code actually running
to deal with those messages (when using the SimpleMessageListenerContainer).
If we have actually closed the connection
(e.g. via CachingConnectionFactory.resetConnection()) this will return false.public int getLocalPort()
getLocalPort in interface com.rabbitmq.client.impl.NetworkConnectiongetLocalPort in interface Connectionpublic java.net.InetAddress getLocalAddress()
getLocalAddress in interface com.rabbitmq.client.impl.NetworkConnectionpublic java.net.InetAddress getAddress()
getAddress in interface com.rabbitmq.client.impl.NetworkConnectionpublic int getPort()
getPort in interface com.rabbitmq.client.impl.NetworkConnectionpublic java.lang.String toString()
toString in class java.lang.Object