All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.agletx.patterns.Messenger

java.lang.Object
   |
   +----com.ibm.aglet.Aglet
           |
           +----com.ibm.agletx.patterns.Messenger

public final class Messenger
extends Aglet
Create a Messenger by calling the static method create. The messenger will get dispatched automatically. The messenger carries a message between two remote aglets. Upon reaching the host of the receiver aglet and sending the message, the messenger complete its job and so, it is disposed. If a Messenger cannot be dispatched, it is disposed.


Constructor Index

 o Messenger()

Method Index

 o create(AgletContext, URL, AgletID, Message)
Creates a messenger.
 o onCreation(Object)
Initializes the messenger.
 o run()
Universal entry point for the messenger's execution thread.

Constructors

 o Messenger
 public Messenger()

Methods

 o create
 public static AgletProxy create(AgletContext context,
                                 URL dest,
                                 AgletID id,
                                 Message message) throws IOException, AgletException
Creates a messenger.

Parameters:
context - the aglet context in which the messenger should be created.
dest - the host of the receiver aglet.
id - the identifier of the receiver aglet.
message - the message object.
Returns:
an aglet proxy for the messenger.
Throws: AgletException
if initialization fails.
 o onCreation
 public synchronized void onCreation(Object object)
Initializes the messenger. The argument object containes the destination URL, the message and the identifier of the receiver aglet.

Throws: AgletException
if initialization fails.
Overrides:
onCreation in class Aglet
 o run
 public void run()
Universal entry point for the messenger's execution thread.

Overrides:
run in class Aglet

All Packages  Class Hierarchy  This Package  Previous  Next  Index