com.caucho.bam.broker
Class HashMapBroker

java.lang.Object
  extended by com.caucho.bam.broker.AbstractBrokerStream
      extended by com.caucho.bam.broker.AbstractBroker
          extended by com.caucho.bam.broker.AbstractManagedBroker
              extended by com.caucho.bam.broker.HashMapBroker
All Implemented Interfaces:
Broker, ManagedBroker, MessageStream

public class HashMapBroker
extends AbstractManagedBroker

The abstract implementation of an MessageStream returns query errors for RPC packets, and ignores unknown packets for messages and presence announcement. Most developers will use SkeletonActorFilter or SimpleActor because those classes use introspection with @Message annotations to simplify Actor development.


Constructor Summary
HashMapBroker(java.lang.String address)
           
 
Method Summary
 void addMailbox(Mailbox mailbox)
          Adds a new actor to the broker.
 java.lang.String getAddress()
          Returns the address for the broker itself.
 Mailbox getMailbox(java.lang.String address)
          Returns the actor stream for the given address.
 void removeMailbox(MessageStream actor)
          Removes an actor from the broker.
 
Methods inherited from class com.caucho.bam.broker.AbstractManagedBroker
createAgent, createAgent, createClient, createMailbox, createMailbox, isClosed, removeMailbox
 
Methods inherited from class com.caucho.bam.broker.AbstractBroker
close, getBroker, getBrokerMailbox
 
Methods inherited from class com.caucho.bam.broker.AbstractBrokerStream
message, messageError, query, queryError, queryResult, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.bam.broker.Broker
close, getBrokerMailbox
 
Methods inherited from interface com.caucho.bam.stream.MessageStream
getBroker, message, messageError, query, queryError, queryResult
 

Constructor Detail

HashMapBroker

public HashMapBroker(java.lang.String address)
Method Detail

getAddress

public java.lang.String getAddress()
Returns the address for the broker itself.

Specified by:
getAddress in interface MessageStream
Overrides:
getAddress in class AbstractBroker

getMailbox

public Mailbox getMailbox(java.lang.String address)
Returns the actor stream for the given address.

Specified by:
getMailbox in interface Broker
Overrides:
getMailbox in class AbstractBroker
Parameters:
address - the address of the mailbox
Returns:
the mailbox with the given address or null

addMailbox

public void addMailbox(Mailbox mailbox)
Adds a new actor to the broker.

Specified by:
addMailbox in interface Broker
Specified by:
addMailbox in interface ManagedBroker
Overrides:
addMailbox in class AbstractManagedBroker

removeMailbox

public void removeMailbox(MessageStream actor)
Removes an actor from the broker.