|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.aglet.event.MobilityAdapter | +--com.ibm.agletx.util.SeqItinerary
Define an abstract interface for an aglet's itinerary. An Itinerary is a set of pairs of the form [host, task] where the task should be performed upon arrival of the aglet to the host.
Task
, Serialized FormField Summary | |
protected Aglet |
aglet
|
protected AgletProxy |
currentTarget
|
Constructor Summary | |
SeqItinerary(Aglet aglet)
Constructor. |
Method Summary | |
void |
addAddress(java.lang.String address)
Add a new destination |
java.util.Enumeration |
addresses()
Return an enumeration of all the addresses |
void |
addTask(java.lang.String address,
Task task)
Add a new task |
boolean |
atLastDestination()
Check if at the last destination |
void |
clear()
Empty the itineray |
java.lang.String |
getAddressAt(int index)
Return the address at the specified index. |
java.lang.String |
getCurrentAddress()
Return the address of the current destination |
protected Task |
getCurrentTask()
Return the task to be preformed at the current destination |
java.lang.String |
getOrigin()
Return the address of the origin |
AgletProxy |
getOwnerAglet()
Return the Proxy of the owner aglet |
Task |
getTaskAt(int index)
Return the task at a specific index |
void |
goToNext()
Go to the next address and perform the next task |
void |
handleException(java.lang.Throwable ex)
Handle exception during task execution |
void |
handleTripException(java.lang.Throwable ex)
Handle exception during the travelling of the owner aglet (try to dispatch to the next destination). |
int |
indexOf(java.lang.String address)
Return the index of a specific address |
int |
indexOf(Task task)
Return the index of a specific task |
boolean |
isRepeat()
Check if the itinerary is a cyclic one. |
void |
onArrival(MobilityEvent ev)
This is not normally used by aglets programmers. |
protected void |
onTermination()
|
void |
removeTaskAt(int index)
Remove a task at a specific index |
void |
setRepeat(boolean b)
Define whether the itinerary is to be repeated (cyclic) |
int |
size()
Return the size of the aglet's itinerary. |
void |
startTrip()
Start the trip defined in this itinerary |
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 |
protected Aglet aglet
protected transient AgletProxy currentTarget
Constructor Detail |
public SeqItinerary(Aglet aglet)
aglet
- the owner agletMethod Detail |
public void addAddress(java.lang.String address)
the
- address of the host where the task is to be executed.public java.util.Enumeration addresses()
public void addTask(java.lang.String address, Task task)
task
- the task to be addedthe
- address of the host where the task is to be executed.public boolean atLastDestination()
public void clear()
public java.lang.String getAddressAt(int index)
public java.lang.String getCurrentAddress()
protected Task getCurrentTask()
public java.lang.String getOrigin()
public AgletProxy getOwnerAglet()
public Task getTaskAt(int index)
public void goToNext()
public void handleException(java.lang.Throwable ex)
ex
- the exceptionpublic void handleTripException(java.lang.Throwable ex)
ex
- the exceptionpublic int indexOf(Task task)
public int indexOf(java.lang.String address)
public boolean isRepeat()
public void onArrival(MobilityEvent ev)
onArrival
in class MobilityAdapter
protected void onTermination()
public void removeTaskAt(int index)
public void setRepeat(boolean b)
public int size()
public void startTrip()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |