com.caucho.bam.broker
Class AbstractBroker

java.lang.Object
  extended by com.caucho.bam.broker.AbstractBrokerStream
      extended by com.caucho.bam.broker.AbstractBroker
All Implemented Interfaces:
Broker, MessageStream
Direct Known Subclasses:
AbstractLinkBroker, AbstractManagedBroker, HmtpWebSocketContextWriter, HmtpWebSocketWriter, PassthroughBroker, ServerGatewayBroker, ServerProxyBroker, XmppBrokerStream, XmppWriter

public abstract class AbstractBroker
extends AbstractBrokerStream
implements Broker

Broker is the hub which routes messages to actors.


Constructor Summary
AbstractBroker()
           
 
Method Summary
 void addMailbox(Mailbox mailbox)
          Adds a mailbox (optional operation).
 void close()
          Close the Broker
 java.lang.String getAddress()
          Returns the broker's address, i.e.
 Broker getBroker()
          The broker returns itself for the broker.
 Mailbox getBrokerMailbox()
          Returns a mailbox to the broker itself
 Mailbox getMailbox(java.lang.String address)
          Returns the actor stream for the given address.
 boolean isClosed()
          Returns true if the broker has been closed
 void removeMailbox(Mailbox mailbox)
          Removes a mailbox (optional operation).
 
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.stream.MessageStream
message, messageError, query, queryError, queryResult
 

Constructor Detail

AbstractBroker

public AbstractBroker()
Method Detail

getAddress

public java.lang.String getAddress()
Returns the broker's address, i.e. the virtual host domain name.

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

getBroker

public Broker getBroker()
The broker returns itself for the broker.

Specified by:
getBroker in interface MessageStream

getBrokerMailbox

public Mailbox getBrokerMailbox()
Returns a mailbox to the broker itself

Specified by:
getBrokerMailbox in interface Broker

getMailbox

public Mailbox getMailbox(java.lang.String address)
Description copied from class: AbstractBrokerStream
Returns the actor stream for the given address.

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

addMailbox

public void addMailbox(Mailbox mailbox)
Description copied from interface: Broker
Adds a mailbox (optional operation).

Specified by:
addMailbox in interface Broker

removeMailbox

public void removeMailbox(Mailbox mailbox)
Description copied from interface: Broker
Removes a mailbox (optional operation).

Specified by:
removeMailbox in interface Broker

isClosed

public boolean isClosed()
Returns true if the broker has been closed

Specified by:
isClosed in interface MessageStream
Overrides:
isClosed in class AbstractBrokerStream

close

public void close()
Description copied from interface: Broker
Close the Broker

Specified by:
close in interface Broker