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.
-
Messenger()
-
-
create(AgletContext, URL, AgletIdentifier, Message)
- Creates a messenger.
-
create(AgletContext, URL, Message)
- Creates a messenger.
-
onCreation(Object)
- Initializes the messenger.
-
run()
- Universal entry point for the messenger's execution thread.
Messenger
public Messenger()
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.
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.
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
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