com.caucho.bam.broker
Class AbstractManagedBroker

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

public abstract class AbstractManagedBroker
extends AbstractBroker
implements ManagedBroker

Broker is the hub which routes messages to actors.


Constructor Summary
AbstractManagedBroker()
           
 
Method Summary
 void addMailbox(Mailbox mailbox)
          Adds a mailbox.
 Agent createAgent(MessageStream actorStream)
          Creates an agent
 Agent createAgent(MessageStream actorStream, MailboxType mailboxType)
          Creates an agent
 Mailbox createClient(Mailbox next, java.lang.String uid, java.lang.String resource)
           
protected  Mailbox createMailbox(MessageStream actorStream, MailboxType mailboxType)
           
protected  Mailbox createMailbox(java.lang.String address, MessageStream actorStream, MailboxType mailboxType)
           
 boolean isClosed()
          Returns true if the broker has been closed
 void removeMailbox(Mailbox mailbox)
          Removes a mailbox.
 
Methods inherited from class com.caucho.bam.broker.AbstractBroker
close, getAddress, getBroker, getBrokerMailbox, getMailbox
 
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, getMailbox
 
Methods inherited from interface com.caucho.bam.stream.MessageStream
getAddress, getBroker, message, messageError, query, queryError, queryResult
 

Constructor Detail

AbstractManagedBroker

public AbstractManagedBroker()
Method Detail

addMailbox

public void addMailbox(Mailbox mailbox)
Adds a mailbox.

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

removeMailbox

public void removeMailbox(Mailbox mailbox)
Removes a mailbox.

Specified by:
removeMailbox in interface Broker
Specified by:
removeMailbox in interface ManagedBroker
Overrides:
removeMailbox in class AbstractBroker

createAgent

public Agent createAgent(MessageStream actorStream)
Creates an agent

Specified by:
createAgent in interface ManagedBroker

createAgent

public Agent createAgent(MessageStream actorStream,
                         MailboxType mailboxType)
Creates an agent

Specified by:
createAgent in interface ManagedBroker

createMailbox

protected Mailbox createMailbox(MessageStream actorStream,
                                MailboxType mailboxType)

createMailbox

protected Mailbox createMailbox(java.lang.String address,
                                MessageStream actorStream,
                                MailboxType mailboxType)

createClient

public Mailbox createClient(Mailbox next,
                            java.lang.String uid,
                            java.lang.String resource)
Specified by:
createClient in interface ManagedBroker
Returns:

isClosed

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

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