com.ibm.agletx.patterns
Class 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.
- See Also:
- Serialized Form
| Methods inherited from class com.ibm.aglet.Aglet |
addCloneListener,
addMobilityListener,
addPersistencyListener,
clone,
deactivate,
dispatch,
dispatch,
dispatchEvent,
dispose,
exitMonitor,
getAgletContext,
getAgletID,
getAgletInfo,
getAudioData,
getCodeBase,
getImage,
getImage,
getMessageManager,
getProtections,
getProxy,
getText,
handleMessage,
notifyAllMessages,
notifyMessage,
onDisposing,
removeCloneListener,
removeMobilityListener,
removePersistencyListener,
setProtections,
setStub,
setText,
snapshot,
subscribeMessage,
suspend,
unsubscribeAllMessages,
unsubscribeMessage,
waitMessage,
waitMessage |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Messenger
public Messenger()
create
public static AgletProxy create(AgletContext context,
java.net.URL dest,
AgletID id,
Message message)
throws java.io.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.
create
public static AgletProxy create(AgletContext context,
java.net.URL codebase,
java.net.URL dest,
AgletID id,
Message message)
throws java.io.IOException,
AgletException
- Creates a messenger.
- Parameters:
context - the aglet context in which the messenger should be created.codebase - the codebase of this classdest - 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.
onCreation
public void onCreation(java.lang.Object object)
- Initializes the messenger. The argument object containes
the destination URL, the message and the identifier of the
receiver aglet.
- Overrides:
- onCreation in class Aglet
- Throws:
- AgletException - if initialization fails.
run
public void run()
- Universal entry point for the messenger's execution thread.
- Overrides:
- run in class Aglet
- Tags copied from class: Aglet
- See Also:
Aglet.onCreation(java.lang.Object),
CloneListener.onClone(com.ibm.aglet.event.CloneEvent),
MobilityListener.onArrival(com.ibm.aglet.event.MobilityEvent),
PersistencyListener.onActivation(com.ibm.aglet.event.PersistencyEvent)