| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TaskManager class stores task objects with their associated conversation IDs for
an agent. The agent must add it's tasks during initialisation.
Each task can be used to handle the messages for a particular conversation that an
agent participates in. For example. if an agent registers with a DF on startup, one task
object can be used to handle this conversation without having to store any state for
other conversations - even if they have the same protocol.
Inner Class Summary | |
public static class | TaskManager.DefaultTaskManagerListener |
public static class | TaskManager.TestSender |
public static class | TaskManager.TestTask1 |
public static class | TaskManager.TestTask2 |
public static class | TaskManager.TestTask3 |
public static class | TaskManager.TestTask4 |
Field Summary | |
(package private) boolean | _shutdown Indicates if the TM has been shutdown |
Constructor Summary | |
TaskManager(FIPAOSAgent owner, MessageSender ms, Task top_level_parent) Constructs an empty task manager. |
Method Summary | |
(package private) void | addEvent(Task task, TaskEvent event) Adds the given TaskEvent to the given Task, and informs the registered listener |
synchronized void | appendToExecutionOrder(Task t) Append a Task to the execution order (Tasks are executed in the order they are added to the execution order). |
(package private) void | forward(ACL acl, Task task) Sends an ACL message on behalf of the given Task. |
synchronized Set | getActiveTasks() List the active Tasks |
(package private) ACL | getNewConversation(String protocol) Sets up a new Conversation using the given protocol |
static void | main(String[] args) |
void | newTask(Task task) Initializes a new "top-level" task and adds it to the TaskManager. |
(package private) void | newTask(Task task, Task parent) Creates a new Task with the given parent |
void | newTask(Task t, String id) Initializes a new "top-level" task and adds it to the TaskManager. |
void | newTask(Task t, Conversation conv) Initializes a new "top-level" task and adds it to the TaskManager. |
void | newTask(Task task, Conversation conv, Task parent) Initializes a new child-task and adds it to the TaskManager. |
(package private) void | newTask(Task task, long timeout) Initialises the given task, and invokes its start() method. |
(package private) void | newTask(Task task, long timeout, Task parent) Initialises the given task, and invokes its start() method. |
(package private) void | newTask(Task task, Conversation conv, long timeout) Initialises the given task, and invokes its start() method. |
void | newTask(Task task, Conversation conv, long timeout, Task parent) Initializes a new "top-level" task and adds it to the TaskManager. |
void | notify(Conversation conv) Conversation listener method to deal with conversations being sent by the planner scheduler. |
void | notify(Enumeration enum) Deals with multiple conversations at once - just calls notify( Conversation ) for each one. |
boolean | removeTask(String key) Removes a task object associated with the specified conversation id from the manager. |
boolean | removeTask(Task task) Removes a task object from the manager. |
void | run() Method invoked when the TM starts |
void | setMessageSender(MessageSender ms) Sets the MessageSender that this should use |
synchronized void | setTaskManagerListener(TaskManagerListener tml) Setup the TaskManageristener |
synchronized void | shutdown() Shuts-down this TaskManager - prevents any new Tasks from starting |
Field Detail |
boolean _shutdown
Constructor Detail |
public TaskManager(FIPAOSAgent owner, MessageSender ms, Task top_level_parent)
Method Detail |
void addEvent(Task task, TaskEvent event)
public synchronized void appendToExecutionOrder(Task t)
void forward(ACL acl, Task task)
Sends an ACL message on behalf of the given Task.
If the message is part of a new conversation, a Conversation object will be created within the ConversationManager and the Task will be bound to that Conversation's ID - hence the task will subsequently receive any messages in response automatically. Note: a call to this method will update the table of all conversation ids and related tasks so that the conversation id is always associated with the last task that calls this method.
public synchronized Set getActiveTasks()
ACL getNewConversation(String protocol)
public static void main(String[] args)
public void newTask(Task task)
void newTask(Task task, Task parent)
public void newTask(Task t, String id)
public void newTask(Task t, Conversation conv)
public void newTask(Task task, Conversation conv, Task parent)
void newTask(Task task, long timeout)
void newTask(Task task, long timeout, Task parent)
void newTask(Task task, Conversation conv, long timeout)
public void newTask(Task task, Conversation conv, long timeout, Task parent)
public void notify(Conversation conv)
public void notify(Enumeration enum)
public boolean removeTask(String key)
public boolean removeTask(Task task)
public void run()
public void setMessageSender(MessageSender ms)
public synchronized void setTaskManagerListener(TaskManagerListener tml)
public synchronized void shutdown()
Association Links |
to Class java.lang.String
to Class java.util.Map
to Class java.util.Set
to Class java.util.Set
to Class fipaos.agent.FIPAOSAgent
to Class fipaos.mts.MessageSender
to Class fipaos.util.Queue
to Class fipaos.agent.task.TaskManagerListener
to Class java.lang.Thread
to Class fipaos.agent.task.Task
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |