org.activemq.broker
Interface BrokerClient

All Superinterfaces:
Service
All Known Implementing Classes:
BrokerClientImpl

public interface BrokerClient
extends Service

A Broker side proxy representing mostly outbound JMS Connnection


Method Summary
 void cleanUp()
          Called when the transport has been terminated, so do our best to shut down any resources and deregister from any subscriptions etc
 void dispatch(ActiveMQMessage message)
          Dispatch an ActiveMQMessage to the end client
 BrokerConnector getBrokerConnector()
           
 int getCapacity()
          Get the Capacity for in-progress messages at the peer (probably a JMSConnection) Legimate values between 0-100.
 TransportChannel getChannel()
           
 String getClientID()
           
 ConnectionInfo getConnectionInfo()
           
 Subject getSubject()
           
 void initialize(BrokerConnector brokerConnector, TransportChannel channel)
          Initialize the Brokerclient
 boolean isBrokerConnection()
           
 boolean isClusteredConnection()
           
 boolean isSlowConsumer()
          Get an indication if the peer should be considered as a slow consumer
 void setSubject(Subject subject)
          Associcates a subject with BrokerClient.
 void updateBrokerCapacity(int capacity)
          Update the peer Connection about the Broker's capacity for messages
 void validateConnection(int timeout)
          Tests the connection to assert that it in fact is alive by asserting that a full round-trip to the client is possible.
 
Methods inherited from interface org.activemq.service.Service
start, stop
 

Method Detail

initialize

public void initialize(BrokerConnector brokerConnector,
                       TransportChannel channel)
Initialize the Brokerclient

Parameters:
brokerConnector -
channel -

dispatch

public void dispatch(ActiveMQMessage message)
Dispatch an ActiveMQMessage to the end client

Parameters:
message -

isBrokerConnection

public boolean isBrokerConnection()
Returns:
true if the peer for this Client is itself another Broker

isClusteredConnection

public boolean isClusteredConnection()
Returns:
true id this client is part of a cluster

getCapacity

public int getCapacity()
Get the Capacity for in-progress messages at the peer (probably a JMSConnection) Legimate values between 0-100. 0 capacity representing that the peer cannot process any more messages at the current time

Returns:

isSlowConsumer

public boolean isSlowConsumer()
Get an indication if the peer should be considered as a slow consumer

Returns:
true id the peer should be considered as a slow consumer

updateBrokerCapacity

public void updateBrokerCapacity(int capacity)
Update the peer Connection about the Broker's capacity for messages

Parameters:
capacity -

getClientID

public String getClientID()
Returns:
the client ID for this client if the client has been initialised

cleanUp

public void cleanUp()
Called when the transport has been terminated, so do our best to shut down any resources and deregister from any subscriptions etc


getChannel

public TransportChannel getChannel()
Returns:
the TransportChannel

getBrokerConnector

public BrokerConnector getBrokerConnector()
Returns:
the BrokerConnector this client is associated with

setSubject

public void setSubject(Subject subject)
Associcates a subject with BrokerClient.


getSubject

public Subject getSubject()
Returns:
the Subject associcates with the BrokerClient.

validateConnection

public void validateConnection(int timeout)
                        throws JMSException
Tests the connection to assert that it in fact is alive by asserting that a full round-trip to the client is possible.

Parameters:
timeout - the number of millisecods to wait before the connection is declared invalid
Throws:
JMSException - if the connection is invalid

getConnectionInfo

public ConnectionInfo getConnectionInfo()
Returns:
the connection information for this client


Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.