fipaos.platform.df
Class DFListenerTask

java.lang.Object
  |
  +--fipaos.agent.task.Task
        |
        +--fipaos.platform.df.DFListenerTask

public class DFListenerTask
extends Task

This Task provides a mechanism for listening to events occuring to a particular DF.

Currently this Task (and its counterpart) only support intra-platform communication over a transport which maintains message content as objects (i.e. RMI).


Fields inherited from class fipaos.agent.task.Task
_children, _lock, _owner, _tm
 
Constructor Summary
DFListenerTask(DFListener listener, AgentID df)
          Creates a DFListenerTask - once the Task has started, it will attempt to subscribe to events from the given DF and forward them to the given DFListener
 
Method Summary
 void handleInform(Conversation conv)
          Invoked when an inform is received - either indicates that the subscription has been setup OK, or indicates an event has occured that meets the requirements of the original subscription request
 void handleNotUnderstood(Conversation conv)
          Deal with not-understood messages here
 void handleRefuse(Conversation conv)
          Invoked when the DF refuses subscription
 void startTask()
          Invoked when the Task starts - sends subscription message to target DF
 void stopListening()
          When invoked, causes the subscription with the DF to be cancelled
 boolean subscribedOK()
          Indicates if this DFListenerTask has been succesfull in subscribing
 
Methods inherited from class fipaos.agent.task.Task
DFSearchResults, done, done, doneDFSearchTask, errorDFSearchTask, forward, forward, getContext, getNewConversation, getState, handleAcceptProposal, handleAgree, handleCfp, handleConfirm, handleDisconfirm, handleFailure, handleInformIf, handleInformRef, handleLateMessage, handleOther, handlePropagate, handlePropose, handleProxy, handleQueryIf, handleQueryRef, 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
 

Constructor Detail

DFListenerTask

public DFListenerTask(DFListener listener,
                      AgentID df)
Creates a DFListenerTask - once the Task has started, it will attempt to subscribe to events from the given DF and forward them to the given DFListener
Parameters:
listener - Object to receive DF event notification
df - DF to monitor
Method Detail

startTask

public void startTask()
Invoked when the Task starts - sends subscription message to target DF
Overrides:
startTask in class Task

subscribedOK

public boolean subscribedOK()
Indicates if this DFListenerTask has been succesfull in subscribing

handleNotUnderstood

public void handleNotUnderstood(Conversation conv)
Deal with not-understood messages here
Overrides:
handleNotUnderstood in class Task

handleRefuse

public void handleRefuse(Conversation conv)
Invoked when the DF refuses subscription
Overrides:
handleRefuse in class Task
Parameters:
conv -  

handleInform

public void handleInform(Conversation conv)
Invoked when an inform is received - either indicates that the subscription has been setup OK, or indicates an event has occured that meets the requirements of the original subscription request
Overrides:
handleInform in class Task
Parameters:
conv -  

stopListening

public void stopListening()
When invoked, causes the subscription with the DF to be cancelled