Package org.apache.activemq.broker
Interface Connection
- All Superinterfaces:
org.apache.activemq.Service
- All Known Implementing Classes:
ManagedTransportConnection,TransportConnection
public interface Connection
extends org.apache.activemq.Service
-
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchAsync(org.apache.activemq.command.Command command) Sends a message to the client.voiddispatchSync(org.apache.activemq.command.Command message) Sends a message to the client.intReturns the number of active transactions established on this Connection.Returns the time in ms since epoch when connection was established.intReturns the number of messages to be dispatched to this connectionReturns the number of active transactions established on this Connection.Returns the statistics for this connectionbooleanisActive()booleanbooleanbooleanbooleanbooleanreturn true if a network connectionbooleanisSlow()org.apache.activemq.command.Responseservice(org.apache.activemq.command.Command command) Services a client command and submits it to the broker.voidserviceException(Throwable error) Handles an unexpected error associated with a connection.voidvoidupdateClient(org.apache.activemq.command.ConnectionControl control) Methods inherited from interface org.apache.activemq.Service
start, stop
-
Method Details
-
getConnector
Connector getConnector()- Returns:
- the connector that created this connection.
-
dispatchSync
void dispatchSync(org.apache.activemq.command.Command message) Sends a message to the client.- Parameters:
message- the message to send to the client.
-
dispatchAsync
void dispatchAsync(org.apache.activemq.command.Command command) Sends a message to the client.- Parameters:
command-
-
service
org.apache.activemq.command.Response service(org.apache.activemq.command.Command command) Services a client command and submits it to the broker.- Parameters:
command-- Returns:
- Response
-
serviceException
Handles an unexpected error associated with a connection.- Parameters:
error-
-
isSlow
boolean isSlow()- Returns:
- true if the Connection is slow
-
isBlocked
boolean isBlocked()- Returns:
- if after being marked, the Connection is still writing
-
isConnected
boolean isConnected()- Returns:
- true if the Connection is connected
-
isActive
boolean isActive()- Returns:
- true if the Connection is active
-
getDispatchQueueSize
int getDispatchQueueSize()Returns the number of messages to be dispatched to this connection -
getStatistics
ConnectionStatistics getStatistics()Returns the statistics for this connection -
isManageable
boolean isManageable()- Returns:
- true if the Connection will process control commands
-
getRemoteAddress
String getRemoteAddress()- Returns:
- the source address for this connection
-
serviceExceptionAsync
-
getConnectionId
String getConnectionId() -
isNetworkConnection
boolean isNetworkConnection()return true if a network connection- Returns:
- if this is a network connection
-
isFaultTolerantConnection
boolean isFaultTolerantConnection()- Returns:
- true if a fault tolerant connection
-
updateClient
void updateClient(org.apache.activemq.command.ConnectionControl control) -
getActiveTransactionCount
int getActiveTransactionCount()Returns the number of active transactions established on this Connection.- Returns:
- the number of active transactions established on this Connection..
-
getOldestActiveTransactionDuration
Long getOldestActiveTransactionDuration()Returns the number of active transactions established on this Connection.- Returns:
- the number of active transactions established on this Connection..
-
getConnectedTimestamp
Long getConnectedTimestamp()Returns the time in ms since epoch when connection was established.- Returns:
- time in ms since epoch when connection was established.
-