TaskManager
- The TaskManager class stores task objects with their
associated conversation IDs for an agent.
- Tasks are self-contained (reusable) pieces of code that
carry out some task and (optionally) return a result, can send
or receive messages, and have little dependance on the agent
they are executed in.
- 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. The agent
can be executing many tasks.
- 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.
- Tasks can spawn child tasks.
- You extend the
Task
class for each task you want. The important methods are:
newTask
: Initialises the given task.
startTask
: is invoked mmediately after the task has been initialised by newTask()
.
done
: When invoked, parent task will have the appropriate doneX()
method invoked.
forward
: Sends a Message.
handleX
: as in handleInform
. These methods must be overriden by your class.
newTask
: Initialises the given task, and invokes its start
method
José M. Vidal
.
7 of 11