Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.broker
Class BrokerClientStub  view BrokerClientStub download BrokerClientStub.java

java.lang.Object
  extended byorg.activemq.broker.BrokerClientStub
All Implemented Interfaces:
BrokerClient, org.activemq.service.Service

public class BrokerClientStub
extends java.lang.Object
implements BrokerClient

A mock dispatcher for testing

Version:
$Revision: 1.1.1.1 $

Field Summary
private  org.activemq.message.ConnectionInfo connectionInfo
           
private  java.util.List messages
           
private  java.lang.Object semaphore
           
private  javax.security.auth.Subject subject
           
 
Constructor Summary
BrokerClientStub()
           
BrokerClientStub(java.lang.Object semaphore)
           
 
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(org.activemq.message.ActiveMQMessage message)
          Dispatch an ActiveMQMessage to the end client
 java.util.List flushMessages()
           
 BrokerConnector getBrokerConnector()
           
 int getCapacity()
          Get the Capacity for in-progress messages at the peer (probably a JMSConnection) Legimate values between 0-100.
 org.activemq.transport.TransportChannel getChannel()
           
 java.lang.String getClientID()
           
 org.activemq.message.ConnectionInfo getConnectionInfo()
           
 javax.security.auth.Subject getSubject()
           
 void initialize(BrokerConnector brokerConnector, org.activemq.transport.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 setConnectionInfo(org.activemq.message.ConnectionInfo connectionInfo)
           
 void setSubject(javax.security.auth.Subject subject)
          Associcates a subject with BrokerClient.
 void start()
          Called to start the service
 void stop()
          Called to shutdown the service
 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.
 void waitForMessageToArrive()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

private java.util.List messages

semaphore

private java.lang.Object semaphore

subject

private javax.security.auth.Subject subject

connectionInfo

private org.activemq.message.ConnectionInfo connectionInfo
Constructor Detail

BrokerClientStub

public BrokerClientStub()

BrokerClientStub

public BrokerClientStub(java.lang.Object semaphore)
Method Detail

getConnectionInfo

public org.activemq.message.ConnectionInfo getConnectionInfo()
Specified by:
getConnectionInfo in interface BrokerClient

setConnectionInfo

public void setConnectionInfo(org.activemq.message.ConnectionInfo connectionInfo)

flushMessages

public java.util.List flushMessages()

dispatch

public void dispatch(org.activemq.message.ActiveMQMessage message)
Description copied from interface: BrokerClient
Dispatch an ActiveMQMessage to the end client

Specified by:
dispatch in interface BrokerClient

initialize

public void initialize(BrokerConnector brokerConnector,
                       org.activemq.transport.TransportChannel channel)
Description copied from interface: BrokerClient
Initialize the Brokerclient

Specified by:
initialize in interface BrokerClient

waitForMessageToArrive

public void waitForMessageToArrive()

start

public void start()
           throws javax.jms.JMSException
Description copied from interface: org.activemq.service.Service
Called to start the service

Specified by:
start in interface org.activemq.service.Service

stop

public void stop()
          throws javax.jms.JMSException
Description copied from interface: org.activemq.service.Service
Called to shutdown the service

Specified by:
stop in interface org.activemq.service.Service

isBrokerConnection

public boolean isBrokerConnection()
Specified by:
isBrokerConnection in interface BrokerClient

getCapacity

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

Specified by:
getCapacity in interface BrokerClient

isSlowConsumer

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

Specified by:
isSlowConsumer in interface BrokerClient

updateBrokerCapacity

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

Specified by:
updateBrokerCapacity in interface BrokerClient

getClientID

public java.lang.String getClientID()
Specified by:
getClientID in interface BrokerClient

cleanUp

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

Specified by:
cleanUp in interface BrokerClient

getChannel

public org.activemq.transport.TransportChannel getChannel()
Specified by:
getChannel in interface BrokerClient

getBrokerConnector

public BrokerConnector getBrokerConnector()
Specified by:
getBrokerConnector in interface BrokerClient

isClusteredConnection

public boolean isClusteredConnection()
Specified by:
isClusteredConnection in interface BrokerClient

validateConnection

public void validateConnection(int timeout)
                        throws javax.jms.JMSException
Description copied from interface: BrokerClient
Tests the connection to assert that it in fact is alive by asserting that a full round-trip to the client is possible.

Specified by:
validateConnection in interface BrokerClient

setSubject

public void setSubject(javax.security.auth.Subject subject)
Description copied from interface: BrokerClient
Associcates a subject with BrokerClient.

Specified by:
setSubject in interface BrokerClient

getSubject

public javax.security.auth.Subject getSubject()
Specified by:
getSubject in interface BrokerClient