Class ibm.aglets.patterns.Messenger
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ibm.aglets.patterns.Messenger

java.lang.Object
   |
   +----aglet.Aglet
           |
           +----aglet.a4compatibility.OldAglet
                   |
                   +----ibm.aglets.patterns.Messenger

public final class Messenger
extends OldAglet
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, AgletIdentifier, Message)
Creates a messenger.
 o create(AgletContext, URL, 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,
                                  AgletIdentifier 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 receiver's agletIdentifier.
message - the message object.
Returns:
an aglet proxy for the messenger.
Throws: AgletException
if initialization fails.
 o create
  public static AgletProxy create(AgletContext context,
                                  URL agletURL,
                                  Message message) throws IOException, AgletException
Creates a messenger.
Parameters:
context - the aglet context in which the messenger should be created.
agletURL - the aglet URL 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 and the the message object.
Throws: AgletException
if initialization fails.
Overrides:
onCreation in class OldAglet
 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