|
|||||||||||
| 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.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 Form| Field Summary | |
protected Aglet |
aglet
|
protected AgletProxy |
currentTarget
|
private java.util.Vector |
hosts
|
private int |
index
|
private java.lang.String |
origin
|
private boolean |
repeat
|
(package private) static long |
serialVersionUID
|
private java.util.Vector |
tasks
|
| 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). |
(package private) void |
incIndex()
|
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 |
private void |
tryNext()
|
| 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
protected Aglet aglet
private java.util.Vector tasks
private java.util.Vector hosts
private int index
protected transient AgletProxy currentTarget
private boolean repeat
private java.lang.String origin
| Constructor Detail |
public SeqItinerary(Aglet aglet)
aglet - the owner aglet| Method Detail |
public void addAddress(java.lang.String address)
public java.util.Enumeration addresses()
public void addTask(java.lang.String address,
Task task)
task - the task to be addedpublic 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 exceptionvoid incIndex()
public int indexOf(Task task)
public int indexOf(java.lang.String address)
public boolean isRepeat()
public void onArrival(MobilityEvent ev)
onArrival in interface MobilityListeneronArrival in class MobilityAdapterprotected void onTermination()
public void removeTaskAt(int index)
public void setRepeat(boolean b)
public int size()
public void startTrip()
private void tryNext()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||