Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

sajas.proto
Class ContractNetResponder
java.lang.Object
  sajas.core.behaviours.Behaviour
      sajas.core.behaviours.CompositeBehaviour
          sajas.core.behaviours.SerialBehaviour
              sajas.core.behaviours.FSMBehaviour
                  sajas.proto.SSContractNetResponder
                      sajas.proto.ContractNetResponder
All Implemented Interfaces:
jade.util.leap.Serializable, Serializable

public class ContractNetResponder
extends SSContractNetResponder
Note: this class has been re-implemented to redirect the use of the agent, behaviour and protocol classes to SAJaS versions.
Author:
hlc
See Also:
jade.proto.ContractNetResponder

Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
Field Summary
String
PROPOSE_ACCEPTANCE_KEY
          Deprecated. Use either ACCEPT_PROPOSAL_KEY or REJECT_PROPOSAL_KEY according to the message that has been received
static String
RECEIVE_CFP
String
RESPONSE_KEY
          Deprecated. Use REPLY_KEY
String
RESULT_NOTIFICATION_KEY
          Deprecated. Use REPLY_KEY
Fields inherited from class sajas.proto.SSContractNetResponder
ACCEPT_PROPOSAL_KEY, CFP_KEY, CHECK_IN_SEQ, DUMMY_FINAL, HANDLE_ACCEPT_PROPOSAL, HANDLE_CFP, HANDLE_OUT_OF_SEQUENCE, HANDLE_REJECT_PROPOSAL, INITIATION_KEY, PROPOSE_KEY, RECEIVE_NEXT, RECEIVED_KEY, REJECT_PROPOSAL_KEY, REPLY_KEY, SEND_REPLY
Fields inherited from class sajas.core.behaviours.FSMBehaviour
currentName, lastStates
Fields inherited from class sajas.core.behaviours.CompositeBehaviour
currentExecuted
Fields inherited from class sajas.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
Constructor Summary
ContractNetResponder(Agent a, jade.lang.acl.MessageTemplate mt)
          Constructor of the behaviour that creates a new empty DataStore
ContractNetResponder(Agent a, jade.lang.acl.MessageTemplate mt, DataStore store)
          Constructor of the behaviour.
Method Summary
static jade.lang.acl.MessageTemplate
createMessageTemplate(String iprotocol)
          This static method can be used to set the proper message Template (based on the interaction protocol and the performative) to be passed to the constructor of this behaviour.
protected jade.lang.acl.ACLMessage
handleAcceptProposal(jade.lang.acl.ACLMessage cfp, jade.lang.acl.ACLMessage propose, jade.lang.acl.ACLMessage accept)
          Redefine this method to call prepareResultNotification()
protected jade.lang.acl.ACLMessage
handleCfp(jade.lang.acl.ACLMessage cfp)
          Redefine this method to call prepareResponse()
protected jade.lang.acl.ACLMessage
prepareResponse(jade.lang.acl.ACLMessage cfp)
          Deprecated. Use handleCfp() instead
protected jade.lang.acl.ACLMessage
prepareResultNotification(jade.lang.acl.ACLMessage cfp, jade.lang.acl.ACLMessage propose, jade.lang.acl.ACLMessage accept)
          Deprecated. Use handleAcceptProposal() instead.
void
registerHandleCfp(Behaviour b)
          Redefine this method so that the HANDLE_CFP state is not registered as first state
void
registerPrepareResponse(Behaviour b)
          Deprecated. Use registerHandleCfp() instead.
void
registerPrepareResultNotification(Behaviour b)
          Deprecated. Use registerHandleAcceptProposal() instead.
protected void
sessionTerminated()
          This method can be redefined by protocol specific implementations to take proper actions after the completion of the current protocol session.
Methods inherited from class sajas.proto.SSContractNetResponder
afterReply, beforeReply, checkInSequence, handleOutOfSequence, handleOutOfSequence, handleRejectProposal, onStart, registerDSState, registerHandleAcceptProposal, registerHandleOutOfSequence, registerHandleRejectProposal, reinit, reset
Methods inherited from class sajas.core.behaviours.FSMBehaviour
checkTermination, deregisterDefaultTransition, deregisterState, deregisterTransition, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, hasDefaultTransition, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, resetStates, scheduleFirst, scheduleNext, stringifyTransitionTable
Methods inherited from class sajas.core.behaviours.SerialBehaviour
handle
Methods inherited from class sajas.core.behaviours.CompositeBehaviour
action, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgent
Methods inherited from class sajas.core.behaviours.Behaviour
actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, isRunnable, restart, root, setBehaviourName, setDataStore, setExecutionState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
PROPOSE_ACCEPTANCE_KEY
public final String PROPOSE_ACCEPTANCE_KEY
Deprecated. Use either ACCEPT_PROPOSAL_KEY or REJECT_PROPOSAL_KEY according to the message that has been received

RECEIVE_CFP
public static final String RECEIVE_CFP
See Also:
Constant Field Values

RESPONSE_KEY
public final String RESPONSE_KEY
Deprecated. Use REPLY_KEY

RESULT_NOTIFICATION_KEY
public final String RESULT_NOTIFICATION_KEY
Deprecated. Use REPLY_KEY
Constructor Detail
ContractNetResponder
public ContractNetResponder(Agent a,
                            jade.lang.acl.MessageTemplate mt)
Constructor of the behaviour that creates a new empty DataStore
See Also:
ContractNetResponder(Agent a, MessageTemplate mt, DataStore store)

ContractNetResponder
public ContractNetResponder(Agent a,
                            jade.lang.acl.MessageTemplate mt,
                            DataStore store)
Constructor of the behaviour.
Parameters:
a - is the reference to the Agent object
mt - is the MessageTemplate that must be used to match the initiator message. Take care that if mt is null every message is consumed by this protocol. The best practice is to have a MessageTemplate that matches the protocol slot; the static method createMessageTemplate might be usefull.
store - the DataStore for this protocol behaviour
Method Detail
prepareResponse
protected jade.lang.acl.ACLMessage prepareResponse(jade.lang.acl.ACLMessage cfp)
                                            throws jade.domain.FIPAAgentManagement.NotUnderstoodException,
                                                   jade.domain.FIPAAgentManagement.RefuseException
Deprecated. Use handleCfp() instead
Throws:
jade.domain.FIPAAgentManagement.NotUnderstoodException
jade.domain.FIPAAgentManagement.RefuseException

prepareResultNotification
protected jade.lang.acl.ACLMessage prepareResultNotification(jade.lang.acl.ACLMessage cfp,
                                                             jade.lang.acl.ACLMessage propose,
                                                             jade.lang.acl.ACLMessage accept)
                                                      throws jade.domain.FIPAAgentManagement.FailureException
Deprecated. Use handleAcceptProposal() instead.
Throws:
jade.domain.FIPAAgentManagement.FailureException

registerPrepareResponse
public void registerPrepareResponse(Behaviour b)
Deprecated. Use registerHandleCfp() instead.

registerPrepareResultNotification
public void registerPrepareResultNotification(Behaviour b)
Deprecated. Use registerHandleAcceptProposal() instead.

handleCfp
protected jade.lang.acl.ACLMessage handleCfp(jade.lang.acl.ACLMessage cfp)
                                      throws jade.domain.FIPAAgentManagement.RefuseException,
                                             jade.domain.FIPAAgentManagement.FailureException,
                                             jade.domain.FIPAAgentManagement.NotUnderstoodException
Redefine this method to call prepareResponse()
Overrides:
handleCfp in class SSContractNetResponder
Parameters:
cfp - the initial CFP message to handle.
Returns:
the reply message to be sent back to the initiator. Returning a message different than PROPOSE (or returning null) terminates the protocol.
Throws:
jade.domain.FIPAAgentManagement.RefuseException - if the CFP is refused. Throwing a RefuseException has the same effect as returning a REFUSE message, but automatically manages the :content slot.
jade.domain.FIPAAgentManagement.FailureException - if there is an error serving the CFP. Throwing a FailureException has the same effect as returning a FAILURE message, but automatically manages the :content slot.
jade.domain.FIPAAgentManagement.NotUnderstoodException - if the CFP content is not understood. Throwing a NotUnderstoodException has the same effect as returning a NOT_UNDERSTOOD message, but automatically manages the :content slot.

handleAcceptProposal
protected jade.lang.acl.ACLMessage handleAcceptProposal(jade.lang.acl.ACLMessage cfp,
                                                        jade.lang.acl.ACLMessage propose,
                                                        jade.lang.acl.ACLMessage accept)
                                                 throws jade.domain.FIPAAgentManagement.FailureException
Redefine this method to call prepareResultNotification()
Overrides:
handleAcceptProposal in class SSContractNetResponder
Parameters:
cfp - the initial CFP message.
propose - the PROPOSE message sent back as reply to the initial CFP message.
accept - the received ACCEPT_PROPOSAL message.
Returns:
the reply message to be sent back to the initiator.
Throws:
jade.domain.FIPAAgentManagement.FailureException - if there is an error serving the ACCEPT_PROPOSAL. Throwing a FailureException has the same effect as returning a FAILURE message, but automatically manages the :content slot.

registerHandleCfp
public void registerHandleCfp(Behaviour b)
Redefine this method so that the HANDLE_CFP state is not registered as first state
Overrides:
registerHandleCfp in class SSContractNetResponder
Parameters:
b - the Behaviour that will handle this state

sessionTerminated
protected void sessionTerminated()
This method can be redefined by protocol specific implementations to take proper actions after the completion of the current protocol session.
Overrides:
sessionTerminated in class SSContractNetResponder

createMessageTemplate
public static jade.lang.acl.MessageTemplate createMessageTemplate(String iprotocol)
This static method can be used to set the proper message Template (based on the interaction protocol and the performative) to be passed to the constructor of this behaviour.
See Also:
jade.domain.FIPANames.InteractionProtocol

Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Java API documentation generated with DocFlex/Doclet 1.6.1 using JavadocPro template set.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc, which is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com