|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibm.aglet.event.MobilityAdapter
com.ibm.agletx.util.SimpleItinerary
SimpleItinerary class is an itinerary object which can specify a destination and a message which will be sent to the owner aglet when it arrived at the destination.
SimpleItinerary itinerary;
public void onCreation(Object init) {
itinerary = new SimpleItinerary(this);
itinerary.go("atp://first", "job1");
}
public boolean handleMessage(Message msg) {
if (msg.sameKind("job1")) {
// job at the first place
itinerary.go("atp://second", "job2");
} else if (msg.sameKind("job2")) {
// job at the second place
itinerary.go("atp://third", "job3");
} else if (msg.sameKind("job3")) {
// job at the third place
dispose();
} else return false;
return true;
}
In above case, what the call itinerary.go("atp://second", "job2")
does is
| Field Summary | |
private Aglet |
aglet
|
private Message |
next
|
private java.util.Hashtable |
plan
|
(package private) static long |
serialVersionUID
|
| Constructor Summary | |
SimpleItinerary()
For Manual Serialization |
|
SimpleItinerary(Aglet aglet)
Constructs a SimpleItinerary with the specified owner aglet. |
|
| Method Summary | |
void |
go(java.lang.String address,
Message msg)
Goes to the destination given by name and the message processed at the destination. |
void |
go(java.lang.String address,
java.lang.String msg)
Goes to the destination given by name and the message processed at the destination. |
void |
onArrival(MobilityEvent ev)
This is not normally used by aglets programmers. |
void |
readExternal(java.io.ObjectInput in)
|
void |
writeExternal(java.io.ObjectOutput oo)
|
| Methods inherited from class com.ibm.aglet.event.MobilityAdapter |
onDispatching, onReverting |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static final long serialVersionUID
private Aglet aglet
private Message next
private java.util.Hashtable plan
| Constructor Detail |
public SimpleItinerary()
public SimpleItinerary(Aglet aglet)
aglet - the owner of this itinerary.| Method Detail |
public void go(java.lang.String address,
Message msg)
throws java.io.IOException,
AgletException
address - the address of the destinationmsg - the message being sent to the aglet at the destination
java.io.IOException - if dispatch completely failed
AgletException - if dispatch completely failed
public void go(java.lang.String address,
java.lang.String msg)
throws java.io.IOException,
AgletException
address - the address of the destinationmsg - the message being sent to the aglet at the destination
java.io.IOException - if dispatch completely failed
AgletException - if dispatch completely failedpublic void onArrival(MobilityEvent ev)
onArrival in interface MobilityListeneronArrival in class MobilityAdapterev - a mobility event
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput oo)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||