fipaos.agent.task
Class TaskState


public class TaskState

Represents the current state of a particular Task within the TaskManager


Field Summary
 final static intTASK_EXECUTING
          Indicates that a Task is currently executing
 final static intTASK_IDLE
          Indicates that a Task is not executing and has no pending events
 final static intTASK_READY_TO_CONTINUE
          Indicates that a Task is ready to continue execution (events pending)
 final static intTASK_READY_TO_START
          Indicates that a Task is ready to start initial execution

Method Summary
 (package private) synchronized voidaddEvent(TaskEvent event)
          Adds a TaskEvent that the Task this belongs to should receive
 synchronized TaskEventgetNextEvent()
          Get the next TaskEvent that the Task this belongs to should receive - this removes the event from the pending list
 synchronized intgetState()
          Get the state of the Task
 synchronized TaskEventpeekNextEvent()
          Peek at the next TaskEvent that the Task this belongs to should receive
 (package private) voidremoveReferences()
          Removes all references to other objects to aid garbage collection
 (package private) synchronized voidsetState(int state)
          Set the current state of the Task this belongs to

Field Detail

TASK_EXECUTING

public final static int TASK_EXECUTING
Indicates that a Task is currently executing

TASK_IDLE

public final static int TASK_IDLE
Indicates that a Task is not executing and has no pending events

TASK_READY_TO_CONTINUE

public final static int TASK_READY_TO_CONTINUE
Indicates that a Task is ready to continue execution (events pending)

TASK_READY_TO_START

public final static int TASK_READY_TO_START
Indicates that a Task is ready to start initial execution
Method Detail

addEvent

synchronized void addEvent(TaskEvent event)

Adds a TaskEvent that the Task this belongs to should receive


getNextEvent

public synchronized TaskEvent getNextEvent()

Get the next TaskEvent that the Task this belongs to should receive - this removes the event from the pending list

Returns: Return null if getState() != TASK_READY_TO_CONTINUE

getState

public synchronized int getState()
Get the state of the Task

peekNextEvent

public synchronized TaskEvent peekNextEvent()

Peek at the next TaskEvent that the Task this belongs to should receive

Returns: Return null if getState() != TASK_READY_TO_CONTINUE

removeReferences

void removeReferences()
Removes all references to other objects to aid garbage collection

setState

synchronized void setState(int state)
Set the current state of the Task this belongs to

Association Links

to Class java.util.List

Pending events for this Task