jadex.bdi.planlib.protocols.request
Class RPInitiatorPlan

java.lang.Object
  extended by jadex.bdi.runtime.impl.AbstractPlan
      extended by jadex.bdi.runtime.Plan
          extended by jadex.bdi.planlib.protocols.AbstractInitiatorPlan
              extended by jadex.bdi.planlib.protocols.request.RPInitiatorPlan
All Implemented Interfaces:
ISuspendable, java.io.Serializable

public class RPInitiatorPlan
extends AbstractInitiatorPlan

The fipa request plan performs the initiator side of the fipa-request protocol. The parameters have to be specified in the goal. The result of the request is stored in the goal.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jadex.bdi.runtime.Plan
Plan.SyncResultListener
 
Field Summary
protected  IMessageEvent request
          The request (must be saved because of conversation tracking).
protected static java.lang.String STATUS_TIMEOUT
          The state indicating a timeout in this plan.
 
Fields inherited from class jadex.bdi.runtime.Plan
lis
 
Fields inherited from class jadex.bdi.runtime.impl.AbstractPlan
interpreter, planinit
 
Constructor Summary
RPInitiatorPlan()
           
 
Method Summary
 void body()
          Perform the request.
protected  IMessageEvent getInitialMessage()
          Get the initial message.
protected  IMessageEvent handleFirstAnswer(IMessageEvent answer)
          Process the first answer.
protected  void handleSecondAnswer(IMessageEvent answer)
          Process the second answer.
protected  void requestFinished(boolean success, java.lang.Object result)
          Method, that is being called, when the request has finished.
 
Methods inherited from class jadex.bdi.planlib.protocols.AbstractInitiatorPlan
aborted, getTimeout
 
Methods inherited from class jadex.bdi.runtime.Plan
createWaitAbstraction, dispatchSubgoalAndWait, dispatchSubgoalAndWait, failed, getMonitor, isEventRegisteredInWaitqueue, passed, resume, sendMessageAndWait, sendMessageAndWait, suspend, waitFor, waitForCondition, waitForCondition, waitForEver, waitForExternalCondition, waitForExternalCondition, waitForFactAdded, waitForFactAdded, waitForFactAddedOrRemoved, waitForFactAddedOrRemoved, waitForFactChanged, waitForFactChanged, waitForFactRemoved, waitForFactRemoved, waitForGoal, waitForGoal, waitForGoal, waitForGoal, waitForInternalEvent, waitForInternalEvent, waitForMessageEvent, waitForMessageEvent, waitForReply, waitForReply, waitForTick, waitForWaitAbstraction, waitForWaitAbstraction
 
Methods inherited from class jadex.bdi.runtime.impl.AbstractPlan
createComponentIdentifier, createComponentIdentifier, createComponentIdentifier, createExpression, createExpression, createGoal, createInternalEvent, createMessageEvent, dispatchInternalEvent, dispatchSubgoal, dispatchTopLevelGoal, endAtomic, fail, fail, fail, getBeliefbase, getBody, getClock, getComponentIdentifier, getComponentName, getDispatchedElement, getEventbase, getException, getExpression, getExpressionbase, getExternalAccess, getFlyweight, getGoalbase, getInterpreter, getLifecycleState, getLogger, getParameter, getParameters, getParameterSet, getParameterSets, getPlanbase, getPlanElement, getPropertybase, getRCapability, getReason, getRPlan, getScope, getState, getTime, getType, getWaitqueue, hasParameter, hasParameterSet, killAgent, sendMessage, startAtomic, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_TIMEOUT

protected static final java.lang.String STATUS_TIMEOUT
The state indicating a timeout in this plan.

See Also:
Constant Field Values

request

protected IMessageEvent request
The request (must be saved because of conversation tracking).

Constructor Detail

RPInitiatorPlan

public RPInitiatorPlan()
Method Detail

body

public void body()
Perform the request.

Specified by:
body in class Plan

handleFirstAnswer

protected IMessageEvent handleFirstAnswer(IMessageEvent answer)
Process the first answer.


handleSecondAnswer

protected void handleSecondAnswer(IMessageEvent answer)
Process the second answer.


requestFinished

protected void requestFinished(boolean success,
                               java.lang.Object result)
Method, that is being called, when the request has finished. Default implementation sets status and result on goal.

Parameters:
success - The final status of the df search.
result - The result object.

getInitialMessage

protected IMessageEvent getInitialMessage()
Get the initial message.

Specified by:
getInitialMessage in class AbstractInitiatorPlan


Copyright © 2010. All Rights Reserved.