com.caucho.bam.broker
Interface Broker

All Superinterfaces:
MessageStream
All Known Subinterfaces:
LinkBroker, ManagedBroker
All Known Implementing Classes:
AbstractBroker, AbstractLinkBroker, AbstractManagedBroker, HashMapBroker, HempBroker, HmtpWebSocketContextWriter, HmtpWebSocketWriter, PassthroughBroker, ServerGatewayBroker, ServerProxyBroker, XmppBrokerStream, XmppWriter

public interface Broker
extends MessageStream

Broker is the hub which routes messages to mailboxes.


Method Summary
 void addMailbox(Mailbox mailbox)
          Adds a mailbox (optional operation).
 void close()
          Close the Broker
 Mailbox getBrokerMailbox()
          Returns the mailbox to the broker itself.
 Mailbox getMailbox(java.lang.String address)
          Returns a mailbox for the given address, or null if the mailbox does not exist.
 void removeMailbox(Mailbox mailbox)
          Removes a mailbox (optional operation).
 
Methods inherited from interface com.caucho.bam.stream.MessageStream
getAddress, getBroker, isClosed, message, messageError, query, queryError, queryResult
 

Method Detail

getBrokerMailbox

Mailbox getBrokerMailbox()
Returns the mailbox to the broker itself.


getMailbox

Mailbox getMailbox(java.lang.String address)
Returns a mailbox for the given address, or null if the mailbox does not exist.

Parameters:
address - the address of the mailbox
Returns:
the mailbox with the given address or null

addMailbox

void addMailbox(Mailbox mailbox)
Adds a mailbox (optional operation).


removeMailbox

void removeMailbox(Mailbox mailbox)
Removes a mailbox (optional operation).


close

void close()
Close the Broker