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


Constructor Index

 o SeqPlanItinerary(Aglet)
Constructs a SeqPlanItinerary object with the specified owner aglet.

Method Index

 o addPlan(String, Message)
Adds the new itinerary item of the form [address, message].
 o addPlan(String, String)
Adds the new itinerary item of the form [address, message].
 o getMessageAt(int)
 o onArrival(MobilityEvent)
This is not normally used by aglets programmers.
 o removePlanAt(int)

Constructors

 o SeqPlanItinerary
 public SeqPlanItinerary(Aglet aglet)
Constructs a SeqPlanItinerary object with the specified owner aglet.

Parameters:
aglet - the owner aglet

Methods

 o getMessageAt
 public Message getMessageAt(int index)
 o 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
 o 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
 o removePlanAt
 public void removePlanAt(int index)
 o 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