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

Constructor Index

 o SeqItinerary(Aglet)
Constructor.

Method Index

 o addAddress(String)
Add a new destination
 o addresses()
Return an enumeration of all the addresses
 o addTask(String, Task)
Add a new task
 o atLastDestination()
Check if at the last destination
 o clear()
Empty the itineray
 o getAddressAt(int)
Return the address at the specified index.
 o getCurrentAddress()
Return the address of the current destination
 o getOrigin()
Return the address of the origin
 o getOwnerAglet()
Return the Proxy of the owner aglet
 o getTaskAt(int)
Return the task at a specific index
 o goToNext()
Go to the next address and perform the next task
 o handleException(Throwable)
Handle exception during task execution
 o handleTripException(Throwable)
Handle exception during the travelling of the owner aglet (try to dispatch to the next destination).
 o indexOf(String)
Return the index of a specific address
 o indexOf(Task)
Return the index of a specific task
 o isRepeat()
Check if the itinerary is a cyclic one.
 o onArrival(MobilityEvent)
This is not normally used by aglets programmers.
 o removeTaskAt(int)
Remove a task at a specific index
 o setRepeat(boolean)
Define whether the itinerary is to be repeated (cyclic)
 o size()
Return the size of the aglet's itinerary.
 o startTrip()
Start the trip defined in this itinerary

Constructors

 o SeqItinerary
 public SeqItinerary(Aglet aglet)
Constructor.

Parameters:
aglet - the owner aglet

Methods

 o getOrigin
 public String getOrigin()
Return the address of the origin

 o getCurrentAddress
 public String getCurrentAddress()
Return the address of the current destination

 o clear
 public void clear()
Empty the itineray

 o size
 public int size()
Return the size of the aglet's itinerary.

 o addresses
 public Enumeration addresses()
Return an enumeration of all the addresses

 o addAddress
 public void addAddress(String address)
Add a new destination

Parameters:
the - address of the host where the task is to be executed.
 o 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.
 o getTaskAt
 public Task getTaskAt(int index)
Return the task at a specific index

 o indexOf
 public int indexOf(Task task)
Return the index of a specific task

 o removeTaskAt
 public void removeTaskAt(int index)
Remove a task at a specific index

 o indexOf
 public int indexOf(String address)
Return the index of a specific address

 o getAddressAt
 public String getAddressAt(int index)
Return the address at the specified index.

 o handleException
 public void handleException(Throwable ex)
Handle exception during task execution

Parameters:
ex - the exception
 o 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
 o atLastDestination
 public synchronized boolean atLastDestination()
Check if at the last destination

 o goToNext
 public void goToNext()
Go to the next address and perform the next task

 o startTrip
 public void startTrip()
Start the trip defined in this itinerary

 o onArrival
 public void onArrival(MobilityEvent ev)
This is not normally used by aglets programmers.

Overrides:
onArrival in class MobilityAdapter
 o getOwnerAglet
 public AgletProxy getOwnerAglet()
Return the Proxy of the owner aglet

 o setRepeat
 public void setRepeat(boolean b)
Define whether the itinerary is to be repeated (cyclic)

 o isRepeat
 public boolean isRepeat()
Check if the itinerary is a cyclic one.


All Packages  Class Hierarchy  This Package  Previous  Next  Index