|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.core.behaviours.Behaviour | +--jade.core.behaviours.CompositeBehaviour | +--jade.core.behaviours.SerialBehaviour | +--jade.core.behaviours.FSMBehaviour | +--jade.proto.SSResponder | +--jade.proto.SSIteratedAchieveREResponder
Single Session version of the Responder role in the Iterated-Fipa-Request protocol.
Field Summary | |
java.lang.String |
CANCEL_KEY
Key to retrieve from the DataStore of the behaviour the last received CANCEL ACLMessage |
static java.lang.String |
HANDLE_CANCEL
|
static java.lang.String |
HANDLE_REQUEST
|
java.lang.String |
INITIATION_KEY
Key to retrieve from the DataStore of the behaviour the initiation ACLMessage that triggered this responder session |
java.lang.String |
RECEIVED_KEY
Key to retrieve from the DataStore of the behaviour the last received ACLMessage |
java.lang.String |
REPLY_KEY
Key to set into the DataStore of the behaviour the new ACLMessage to be sent back to the initiator as a reply. |
java.lang.String |
REQUEST_KEY
Key to retrieve from the DataStore of the behaviour the last received REQUEST ACLMessage |
Fields inherited from class jade.core.behaviours.FSMBehaviour |
currentName, lastStates |
Fields inherited from class jade.core.behaviours.Behaviour |
myAgent |
Constructor Summary | |
SSIteratedAchieveREResponder(Agent a,
ACLMessage request)
Construct a SSIteratedAchieveREResponder that is activated by the reception of a given initiation REQUEST message. |
|
SSIteratedAchieveREResponder(Agent a,
ACLMessage request,
DataStore store)
Construct a SSIteratedAchieveREResponder that is activated by the reception of a given initiation REQUEST message and uses a given DataStore. |
Method Summary | |
void |
closeSessionOnNextReply()
Close the ongoing session, as soon as the next INFORM will be sent back to the initiator without the need for an explicit CANCEL message. |
protected void |
handleCancel(ACLMessage cancel)
This method is called when a CANCEL message is received from the initiator. |
protected void |
handleOutOfSequence(ACLMessage msg)
This method is called whenever a message is received that does not comply to the protocol rules. |
protected ACLMessage |
handleRequest(ACLMessage request)
This method is called to handle the initial REQUEST message and then again whenever a REQUEST message is received. |
void |
registerHandleCancel(Behaviour b)
This method allows to register a user defined Behaviour
in the HANDLE_CANCEL state.
|
void |
registerHandleOutOfSequence(Behaviour b)
This method allows to register a user defined Behaviour
in the HANDLE_OUT_OF_SEQ state.
|
void |
registerHandleRequest(Behaviour b)
This method allows to register a user defined Behaviour
in the HANDLE_REQUEST state.
|
protected void |
reinit()
Re-initialize the internal state without performing a complete reset. |
void |
reset()
Reset this protocol behaviour |
void |
sendAgree(ACLMessage agree)
Utility method to send an optional AGREE message back to the initiator ensuring that all protocol fields are properly set. |
Methods inherited from class jade.core.behaviours.FSMBehaviour |
checkTermination, deregisterState, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, resetStates, scheduleFirst, scheduleNext |
Methods inherited from class jade.core.behaviours.CompositeBehaviour |
action, block, done, resetChildren, restart, setAgent |
Methods inherited from class jade.core.behaviours.Behaviour |
block, getBehaviourName, getDataStore, getParent, isRunnable, onStart, root, setBehaviourName, setDataStore |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final java.lang.String REQUEST_KEY
public final java.lang.String CANCEL_KEY
public static final java.lang.String HANDLE_REQUEST
public static final java.lang.String HANDLE_CANCEL
public final java.lang.String INITIATION_KEY
public final java.lang.String RECEIVED_KEY
public final java.lang.String REPLY_KEY
Constructor Detail |
public SSIteratedAchieveREResponder(Agent a, ACLMessage request)
public SSIteratedAchieveREResponder(Agent a, ACLMessage request, DataStore store)
Method Detail |
protected ACLMessage handleRequest(ACLMessage request) throws RefuseException, FailureException, NotUnderstoodException
request
- the REQUEST message to handle.
sendAgree()
method.
RefuseException
- if the REQUEST is refused. Throwing a
RefuseException has the same effect as returning a REFUSE message,
but automatically manages the :content
slot.
FailureException
- if there is an error serving the REQUEST.
Throwing a FailureException has the same effect as returning a FAILURE
message, but automatically manages the :content
slot.
NotUnderstoodException
- if the REQUEST content is not undrerstood.
Throwing a NotUnderstoodException has the same effect as returning a NOT_UNDERSTOOD
message, but automatically manages the :content
slot.protected void handleCancel(ACLMessage cancel)
cancel
- the received CANCEL message or null if no
further REQUEST message is received from the initiator within the timeout
specified in the :reply-by
slot of the last INFORM message.public void registerHandleRequest(Behaviour b)
Behaviour
in the HANDLE_REQUEST state.
This behaviour would override the homonymous method.
This method also sets the
data store of the registered Behaviour
to the
DataStore of this current behaviour.
REQUEST
message from the datastore at the REQUEST_KEY
key.
REPLY_KEY
key. Putting a message defferent from INFORM
(or null) terminates the protocol.
An optional AGREE message can be sent back to the initiator by
calling the sendAgree()
method.
b
- the Behaviour that will handle this statepublic void registerHandleCancel(Behaviour b)
Behaviour
in the HANDLE_CANCEL state.
This behaviour would override the homonymous method.
This method also sets the
data store of the registered Behaviour
to the
DataStore of this current behaviour.
CANCEL
message received from the datastore at the CANCEL_KEY
key.
b
- the Behaviour that will handle this statepublic void sendAgree(ACLMessage agree)
public void closeSessionOnNextReply()
isSessionClosed()
method of the
SSIteratedAchieveREInitiator
class.
public void reset()
reset
in class jade.proto.SSResponder
protected void handleOutOfSequence(ACLMessage msg)
msg
- the received out-of-sequence message.public void registerHandleOutOfSequence(Behaviour b)
Behaviour
in the HANDLE_OUT_OF_SEQ state.
This behaviour would override the homonymous method.
This method also sets the
data store of the registered Behaviour
to the
DataStore of this current behaviour.
The registered behaviour can retrieve
the out of sequence
ACLMessage object received
from the datastore at the RECEIVED_KEY
key.
b
- the Behaviour that will handle this stateprotected void reinit()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |