fipaos.agent.task
Class SynchronousTask

java.lang.Object
  |
  +--fipaos.agent.task.Task
        |
        +--fipaos.agent.task.SynchronousTask

public class SynchronousTask
extends Task

This task enables a Task to be started and its result to be captured by making a single method invocation


Inner Class Summary
static class SynchronousTask.ErrorResult
          Indicates that an exception occured within the Task
static class SynchronousTask.NoResult
          Indicates that the Task didn't return a result
static class SynchronousTask.TimeoutResult
          Indicates that the Task timed-out
static class SynchronousTask.UnusualResult
          A sub-class is returned by executeTask() when something out of the ordinary happens
 
Fields inherited from class fipaos.agent.task.Task
_children, _lock, _owner, _tm
 
Method Summary
static java.lang.Object executeTask(TaskManager tm, Task t)
          Executes the given Task, and returns the result - in the event that something unexpected happens, an object of type UnusualResult is returned
static java.lang.Object executeTask(TaskManager tm, Task t, long timeout)
          Executes the given Task, and returns the result - in the event that something unexpected happens, an object of type UnusualResult is returned
 void startTask()
          Invoked when the task starts
 
Methods inherited from class fipaos.agent.task.Task
DFSearchResults, done, done, doneDFSearchTask, errorDFSearchTask, forward, forward, getContext, getNewConversation, getState, handleAcceptProposal, handleAgree, handleCfp, handleConfirm, handleDisconfirm, handleFailure, handleInform, handleInformIf, handleInformRef, handleLateMessage, handleNotUnderstood, handleOther, handlePropagate, handlePropose, handleProxy, handleQueryIf, handleQueryRef, handleRefuse, handleRejectProposal, handleRequest, handleRequestWhen, handleRequestWhenever, handleSubscribe, handleUndeliverableMessage, newTask, newTask, newTask, newTask, newTask, newTask, newTask, newTask, notify, notifyDone, notifyError, notifyMessageFailure, notifyMessageForEndedConversation, notifyTimeout, searchDF, searchDF, searchDF, searchDF, searchDF, sendNotUnderstood, setContext, timeoutDFSearchTask
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startTask

public void startTask()
Invoked when the task starts
Overrides:
startTask in class Task

executeTask

public static java.lang.Object executeTask(TaskManager tm,
                                           Task t)
Executes the given Task, and returns the result - in the event that something unexpected happens, an object of type UnusualResult is returned

The Task must not have been initialised

WARNING: This method shouldn't be invoked from within the code for a Task!


executeTask

public static java.lang.Object executeTask(TaskManager tm,
                                           Task t,
                                           long timeout)
Executes the given Task, and returns the result - in the event that something unexpected happens, an object of type UnusualResult is returned

The Task must not have been initialised

WARNING: This method shouldn't be invoked from within the code for a Task!