public static interface ContractNetResponder.MessageAccess
An interface to access the messages handled by a contract net responder. This interface is required in order to access the messages from call-back sub-behaviors registered to handle states of the responder. It is not required by the corresponding call-back methods because they can get and set these messages with their parameters and return values, respectively.
It is important to note that the access to the methods is only possible if the responder is currently in an appropriate state. Otherwise, an illegal state exception is thrown. The corresponding states can be found in the documentation for each access method.
ContractNetResponder
,
ContractNetResponder.getMessageAccess()
Modifier and Type | Method and Description |
---|---|
Message |
getAcceptance()
Returns the acceptance of the initiator.
|
Message |
getCfp()
Returns the original call-for-proposals.
|
Message |
getProposal()
Returns the proposal sent to the initiator.
|
void |
setProposal(ModifiableMessage proposal)
Sets the proposal in reply to a call-for-proposal message.
|
void |
setResultNotification(ModifiableMessage resultNotification)
Sets the result notification prepared after the initiator has
accepted a previous proposal.
|
Message getCfp()
Returns the original call-for-proposals.
This method can be called in all states covered by call-back sub-behaviors (handle-cfp, handle-accept handle-reject).
IllegalStateException
- if the method is called in an illegal statevoid setProposal(ModifiableMessage proposal)
Sets the proposal in reply to a call-for-proposal message. As an alternative to propose messages, the protocol also allows refuse and not-understood messages.
This method can be called in the handle-cfp state only.
proposal
- the proposal createdIllegalStateException
- if the method is called in an illegal stateMessage getProposal()
Returns the proposal sent to the initiator.
This method can be called in the handle-accept and handle-reject states only.
IllegalStateException
- if the method is called in an illegal stateMessage getAcceptance()
Returns the acceptance of the initiator. Actually, this message can be either an accept-proposal or a reject-proposal message.
This method can be called in the handle-accept and handle-reject states only.
IllegalStateException
- if the method is called in an illegal statevoid setResultNotification(ModifiableMessage resultNotification)
Sets the result notification prepared after the initiator has accepted a previous proposal. As an alternative to inform messages, the protocol also allows failure messages.
This method can be called in the handle-accept state only.
resultNotification
- the result notification preparedIllegalStateException
- if the method is called in an illegal stateCopyright © Aimpulse Intelligent Systems GmbH
All rights reserved.