All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.agletx.util.SeqPlanItinerary
java.lang.Object
|
+----com.ibm.aglet.event.MobilityAdapter
|
+----com.ibm.agletx.util.SeqItinerary
|
+----com.ibm.agletx.util.SeqPlanItinerary
- public class SeqPlanItinerary
- extends SeqItinerary
SeqPlanItinerary defines the trip plan which has a sequence of
place-message pair. For example, the plan defined like:
itinerary.addPlan("atp://first", "job1");
itinerary.addPlan("atp://second", "job2");
first dispatches an aglet to the "atp://first" and
sends new Message("job1") message to the aglet. After
that message handling is completed, the itinerary dispatches the aglet
to the next address, "atp://second" , and send the
corresponding message new Message("job2", init)
to the aglet again.
The order of plan is defined in the order addPlan method is called,
or you can insert a new plan item at the specified index by calling
insertPlanAt . To automatically dispatches an aglet to the next
address when the job is completed, the aglet have to have the following
block
-
SeqPlanItinerary(Aglet)
- Constructs a SeqPlanItinerary object with the specified owner aglet.
-
addPlan(String, Message)
- Adds the new itinerary item of the form [address, message].
-
addPlan(String, String)
- Adds the new itinerary item of the form [address, message].
-
getMessageAt(int)
-
-
onArrival(MobilityEvent)
- This is not normally used by aglets programmers.
-
removePlanAt(int)
-
SeqPlanItinerary
public SeqPlanItinerary(Aglet aglet)
- Constructs a SeqPlanItinerary object with the specified owner aglet.
- Parameters:
- aglet - the owner aglet
getMessageAt
public Message getMessageAt(int index)
addPlan
public void addPlan(String address,
Message msg)
- Adds the new itinerary item of the form [address, message].
- Parameters:
- address - the address to go
- msg - the message to be sent to the owner aglet
addPlan
public void addPlan(String address,
String msg)
- Adds the new itinerary item of the form [address, message].
This is added at the end of plan.
- Parameters:
- address - the address to go
- msg - the message to be sent to the owner aglet
removePlanAt
public void removePlanAt(int index)
onArrival
public void onArrival(MobilityEvent ev)
- This is not normally used by aglets programmers.
- Overrides:
- onArrival in class SeqItinerary
All Packages Class Hierarchy This Package Previous Next Index