com.caucho.amp.broker
Class AbstractAmpBroker

java.lang.Object
  extended by com.caucho.amp.broker.AbstractAmpBroker
All Implemented Interfaces:
AmpBroker
Direct Known Subclasses:
HashMapAmpBroker

public class AbstractAmpBroker
extends java.lang.Object
implements AmpBroker

AmpRouter routes messages to mailboxes.


Constructor Summary
AbstractAmpBroker()
           
 
Method Summary
 AmpActorRef addMailbox(java.lang.String address, AmpMailbox mailbox)
          Adds a mailbox (optional operation).
 void close()
          Close the broker.
 AmpActorRef getActorRef(java.lang.String to)
          Returns a mailbox for the given address, or null if the mailbox does not exist.
 AmpActorRef getBrokerActor()
          Returns the mailbox to the router itself.
 void query(long id, java.lang.String to, java.lang.String from, AmpEncoder encoder, java.lang.String methodName, java.lang.Object... args)
           
 void removeMailbox(java.lang.String address, AmpMailbox mailbox)
          Removes a mailbox (optional operation).
 void reply(long id, java.lang.String to, java.lang.String from, AmpEncoder encoder, java.lang.Object result)
           
 void send(java.lang.String to, java.lang.String from, AmpEncoder encoder, java.lang.String methodName, java.lang.Object... args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAmpBroker

public AbstractAmpBroker()
Method Detail

getActorRef

public AmpActorRef getActorRef(java.lang.String to)
Description copied from interface: AmpBroker
Returns a mailbox for the given address, or null if the mailbox does not exist.

Specified by:
getActorRef in interface AmpBroker
Parameters:
to - the address of the mailbox
Returns:
the mailbox with the given address or null

addMailbox

public AmpActorRef addMailbox(java.lang.String address,
                              AmpMailbox mailbox)
Description copied from interface: AmpBroker
Adds a mailbox (optional operation).

Specified by:
addMailbox in interface AmpBroker

removeMailbox

public void removeMailbox(java.lang.String address,
                          AmpMailbox mailbox)
Description copied from interface: AmpBroker
Removes a mailbox (optional operation).

Specified by:
removeMailbox in interface AmpBroker

close

public void close()
Description copied from interface: AmpBroker
Close the broker.

Specified by:
close in interface AmpBroker

getBrokerActor

public AmpActorRef getBrokerActor()
Description copied from interface: AmpBroker
Returns the mailbox to the router itself.

Specified by:
getBrokerActor in interface AmpBroker

send

public void send(java.lang.String to,
                 java.lang.String from,
                 AmpEncoder encoder,
                 java.lang.String methodName,
                 java.lang.Object... args)
Specified by:
send in interface AmpBroker

query

public void query(long id,
                  java.lang.String to,
                  java.lang.String from,
                  AmpEncoder encoder,
                  java.lang.String methodName,
                  java.lang.Object... args)
Specified by:
query in interface AmpBroker

reply

public void reply(long id,
                  java.lang.String to,
                  java.lang.String from,
                  AmpEncoder encoder,
                  java.lang.Object result)
Specified by:
reply in interface AmpBroker