Interface Connection
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ConnectionProxy
- All Known Implementing Classes:
SimpleConnection
- Author:
- Dave Syer, Gary Russell, Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockedListener(com.rabbitmq.client.BlockedListener listener) Add aBlockedListener.voidclose()Close this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'.default voidClose any channel associated with the current thread.com.rabbitmq.client.ChannelcreateChannel(boolean transactional) Create a new channel, using an internally allocated channel number.default com.rabbitmq.client.ConnectionReturn the underlying RabbitMQ connection.intbooleanisOpen()Flag to indicate the status of the connection.booleanremoveBlockedListener(com.rabbitmq.client.BlockedListener listener) Remove aBlockedListener.
-
Method Details
-
createChannel
Create a new channel, using an internally allocated channel number.- Parameters:
transactional- true if the channel should support transactions- Returns:
- a new channel descriptor, or null if none is available
- Throws:
AmqpException- if an I/O problem is encountered
-
close
Close this connection and all its channels with theAMQP.REPLY_SUCCESSclose code and message 'OK'. Waits for all the close operations to complete.- Specified by:
closein interfaceAutoCloseable- Throws:
AmqpException- if an I/O problem is encountered
-
isOpen
boolean isOpen()Flag to indicate the status of the connection.- Returns:
- true if the connection is open
-
getLocalPort
int getLocalPort()- Returns:
- the local port if the underlying connection supports it.
-
addBlockedListener
void addBlockedListener(com.rabbitmq.client.BlockedListener listener) Add aBlockedListener.- Parameters:
listener- the listener to add- Since:
- 2.0
- See Also:
-
removeBlockedListener
boolean removeBlockedListener(com.rabbitmq.client.BlockedListener listener) Remove aBlockedListener.- Parameters:
listener- the listener to remove- Returns:
trueif the listener was found and removed,falseotherwise- Since:
- 2.0
- See Also:
-
getDelegate
Return the underlying RabbitMQ connection.- Returns:
- the connection.
-
closeThreadChannel
default void closeThreadChannel()Close any channel associated with the current thread.
-