com.caucho.bam.actor
Class AbstractAgent

java.lang.Object
  extended by com.caucho.bam.actor.AbstractAgent
All Implemented Interfaces:
Agent

public class AbstractAgent
extends java.lang.Object
implements Agent

A BAM Actor sends and receives messages as the core class in a service-oriented architecture.

Core API

Each actor has a unique address, which is the address for messages sent to the actor. addresss look like email addresses: harry@caucho.com or harry@caucho.com/browser13. MessageStream is the key customizable interface for an agent developer. Developers will implement callbacks for each packet type the agent understands. Most developers will extend from SimpleActor instead of implementing Actor directly. SimpleActor adds an annotation-based message dispatching system to simplify Actor development.


Constructor Summary
protected AbstractAgent()
           
  AbstractAgent(java.lang.String address, Mailbox mailbox, Broker broker)
           
 
Method Summary
 java.lang.String getAddress()
          Returns the actor's address, so the Broker can deliver messages to this actor.
 Broker getBroker()
          Returns the actor's broker.
 Mailbox getMailbox()
          The stream to send messages to the actor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAgent

protected AbstractAgent()

AbstractAgent

public AbstractAgent(java.lang.String address,
                     Mailbox mailbox,
                     Broker broker)
Method Detail

getAddress

public java.lang.String getAddress()
Returns the actor's address, so the Broker can deliver messages to this actor.

Specified by:
getAddress in interface Agent

getMailbox

public Mailbox getMailbox()
The stream to send messages to the actor.

Specified by:
getMailbox in interface Agent

getBroker

public Broker getBroker()
Returns the actor's broker.

Specified by:
getBroker in interface Agent

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object