org.apache.activemq.broker
Interface Connection

All Superinterfaces:
Service
All Known Implementing Classes:
ManagedTransportConnection, TransportConnection

public interface Connection
extends Service


Method Summary
 void dispatchAsync(Command command)
          Sends a message to the client.
 void dispatchSync(Command message)
          Sends a message to the client.
 String getConnectionId()
           
 Connector getConnector()
           
 int getDispatchQueueSize()
          Returns the number of messages to be dispatched to this connection
 String getRemoteAddress()
           
 ConnectionStatistics getStatistics()
          Returns the statistics for this connection
 boolean isActive()
           
 boolean isBlocked()
           
 boolean isConnected()
           
 boolean isFaultTolerantConnection()
           
 boolean isManageable()
           
 boolean isNetworkConnection()
          return true if a network connection
 boolean isSlow()
           
 Response service(Command command)
          Services a client command and submits it to the broker.
 void serviceException(Throwable error)
          Handles an unexpected error associated with a connection.
 void serviceExceptionAsync(IOException e)
           
 void updateClient(ConnectionControl control)
           
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

getConnector

Connector getConnector()
Returns:
the connector that created this connection.

dispatchSync

void dispatchSync(Command message)
Sends a message to the client.

Parameters:
message - the message to send to the client.

dispatchAsync

void dispatchAsync(Command command)
Sends a message to the client.

Parameters:
command -

service

Response service(Command command)
Services a client command and submits it to the broker.

Parameters:
command -
Returns:
Response

serviceException

void serviceException(Throwable error)
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

void serviceExceptionAsync(IOException e)

getConnectionId

String getConnectionId()

isNetworkConnection

boolean isNetworkConnection()
return true if a network connection

Returns:

isFaultTolerantConnection

boolean isFaultTolerantConnection()
Returns:
true if a fault tolerant connection

updateClient

void updateClient(ConnectionControl control)


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.