com.ibm.agletx.util
Class 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
- See Also:
- Serialized Form
|
Constructor Summary |
SeqPlanItinerary(Aglet aglet)
Constructs a SeqPlanItinerary object with the specified owner aglet. |
|
Method Summary |
void |
addPlan(java.lang.String address,
Message msg)
Adds the new itinerary item of the form [address, message]. |
void |
addPlan(java.lang.String address,
java.lang.String msg)
Adds the new itinerary item of the form [address, message]. |
Message |
getMessageAt(int index)
|
void |
onArrival(MobilityEvent ev)
This is not normally used by aglets programmers. |
void |
removePlanAt(int index)
|
| Methods inherited from class com.ibm.agletx.util.SeqItinerary |
addAddress,
addresses,
addTask,
atLastDestination,
clear,
getAddressAt,
getCurrentAddress,
getOrigin,
getOwnerAglet,
getTaskAt,
goToNext,
handleException,
handleTripException,
indexOf,
indexOf,
isRepeat,
removeTaskAt,
setRepeat,
size,
startTrip |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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(java.lang.String address,
Message msg)
- Adds the new itinerary item of the form [address, message].
- Parameters:
address - the address to gomsg - the message to be sent to the owner aglet
addPlan
public void addPlan(java.lang.String address,
java.lang.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 gomsg - the message to be sent to the owner aglet
removePlanAt
public void removePlanAt(int index)
onArrival
public void onArrival(MobilityEvent ev)
- Description copied from class: SeqItinerary
- This is not normally used by aglets programmers.
- Overrides:
- onArrival in class SeqItinerary