All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.agletx.util.SeqItinerary
java.lang.Object
|
+----com.ibm.aglet.event.MobilityAdapter
|
+----com.ibm.agletx.util.SeqItinerary
- public abstract class SeqItinerary
- extends MobilityAdapter
- implements Serializable
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.
- See Also:
- Task
-
SeqItinerary(Aglet)
- Constructor.
-
addAddress(String)
- Add a new destination
-
addresses()
- Return an enumeration of all the addresses
-
addTask(String, Task)
- Add a new task
-
atLastDestination()
- Check if at the last destination
-
clear()
- Empty the itineray
-
getAddressAt(int)
- Return the address at the specified index.
-
getCurrentAddress()
- Return the address of the current destination
-
getOrigin()
- Return the address of the origin
-
getOwnerAglet()
- Return the Proxy of the owner aglet
-
getTaskAt(int)
- Return the task at a specific index
-
goToNext()
- Go to the next address and perform the next task
-
handleException(Throwable)
- Handle exception during task execution
-
handleTripException(Throwable)
- Handle exception during the travelling of the owner aglet
(try to dispatch to the next destination).
-
indexOf(String)
- Return the index of a specific address
-
indexOf(Task)
- Return the index of a specific task
-
isRepeat()
- Check if the itinerary is a cyclic one.
-
onArrival(MobilityEvent)
- This is not normally used by aglets programmers.
-
removeTaskAt(int)
- Remove a task at a specific index
-
setRepeat(boolean)
- Define whether the itinerary is to be repeated (cyclic)
-
size()
- Return the size of the aglet's itinerary.
-
startTrip()
- Start the trip defined in this itinerary
SeqItinerary
public SeqItinerary(Aglet aglet)
- Constructor.
- Parameters:
- aglet - the owner aglet
getOrigin
public String getOrigin()
- Return the address of the origin
getCurrentAddress
public String getCurrentAddress()
- Return the address of the current destination
clear
public void clear()
- Empty the itineray
size
public int size()
- Return the size of the aglet's itinerary.
addresses
public Enumeration addresses()
- Return an enumeration of all the addresses
addAddress
public void addAddress(String address)
- Add a new destination
- Parameters:
- the - address of the host where the task is to be executed.
addTask
public void addTask(String address,
Task task)
- Add a new task
- Parameters:
- task - the task to be added
- the - address of the host where the task is to be executed.
getTaskAt
public Task getTaskAt(int index)
- Return the task at a specific index
indexOf
public int indexOf(Task task)
- Return the index of a specific task
removeTaskAt
public void removeTaskAt(int index)
- Remove a task at a specific index
indexOf
public int indexOf(String address)
- Return the index of a specific address
getAddressAt
public String getAddressAt(int index)
- Return the address at the specified index.
handleException
public void handleException(Throwable ex)
- Handle exception during task execution
- Parameters:
- ex - the exception
handleTripException
public void handleTripException(Throwable ex)
- Handle exception during the travelling of the owner aglet
(try to dispatch to the next destination).
- Parameters:
- ex - the exception
atLastDestination
public synchronized boolean atLastDestination()
- Check if at the last destination
goToNext
public void goToNext()
- Go to the next address and perform the next task
startTrip
public void startTrip()
- Start the trip defined in this itinerary
onArrival
public void onArrival(MobilityEvent ev)
- This is not normally used by aglets programmers.
- Overrides:
- onArrival in class MobilityAdapter
getOwnerAglet
public AgletProxy getOwnerAglet()
- Return the Proxy of the owner aglet
setRepeat
public void setRepeat(boolean b)
- Define whether the itinerary is to be repeated (cyclic)
isRepeat
public boolean isRepeat()
- Check if the itinerary is a cyclic one.
All Packages Class Hierarchy This Package Previous Next Index