|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
A message policy that always returns the same decision. More...

Public Member Functions | |
| void | notifyIn (Message msg) |
| Decision | notifyOut (Message msg) |
| ConstantMsgPolicy (String forward, boolean forwardToSelf) | |
| Constructor. | |
| ConstantMsgPolicy (String forward, boolean forwardToSelf, MessageType msgType) | |
| Constructor. | |
| void | setOutDecision (Decision outDecision) |
| void | setForward (String forward) |
| void | setForwardToSelfFlag (boolean forwardToSelf) |
| void | setQueue (Queue queue) |
| Collection< MessageType > | getMsgTypes () |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< MessageType > | |
| void | notifyIn (Message msg) |
| Notifies the listener of an incoming message. | |
| Public Member Functions inherited from frodo2.communication.OutgoingMsgPolicyInterface< MessageType > | |
| Decision | notifyOut (Message msg) |
| Notifies the listener of an outgoing message. | |
Private Attributes | |
| String | forward |
Where to forward messages; no forwarding if null. | |
| Boolean | forwardToSelf |
| Whether the policy should forward messages to the queue itself. | |
| Decision | outDecision = Decision.DONTCARE |
| The output of notifyOut(). | |
| Queue | queue |
| Queue from which to call the sendMessage() method when the message must be forwarded. | |
| Object | queue_lock = new Object() |
| Lock for queue used for synchronization. | |
| ArrayList< MessageType > | msgTypes = new ArrayList <MessageType> () |
| The list of messages types this listener wants to be notified of. | |
A message policy that always returns the same decision.
| frodo2.communication.QueueTest.ConstantMsgPolicy.ConstantMsgPolicy | ( | String | forward, |
| boolean | forwardToSelf ) |
Constructor.
By default, it listens to messages of type MessageType.ROOT_TYPE.
| forward | Where to forward messages; no forwarding if null |
| forwardToSelf | Whether the policy should forward messages to the queue itself |
References forward, forwardToSelf, msgTypes, and frodo2.communication.MessageType.ROOT.
| frodo2.communication.QueueTest.ConstantMsgPolicy.ConstantMsgPolicy | ( | String | forward, |
| boolean | forwardToSelf, | ||
| MessageType | msgType ) |
Constructor.
| forward | Where to forward messages; no forwarding if null |
| forwardToSelf | Whether the policy should forward messages to the queue itself |
| msgType | the type of messages this listens to |
References forward, forwardToSelf, and msgTypes.
| Collection< MessageType > frodo2.communication.QueueTest.ConstantMsgPolicy.getMsgTypes | ( | ) |
References msgTypes.
| void frodo2.communication.QueueTest.ConstantMsgPolicy.notifyIn | ( | Message | msg | ) |
References forward, forwardToSelf, and queue.
| Decision frodo2.communication.QueueTest.ConstantMsgPolicy.notifyOut | ( | Message | msg | ) |
| void frodo2.communication.QueueTest.ConstantMsgPolicy.setForward | ( | String | forward | ) |
| forward | Where to forward messages; no forwarding if null |
References forward.
Referenced by frodo2.communication.QueueTest.testDiscard(), and frodo2.communication.QueueTest.testForwardByType().
| void frodo2.communication.QueueTest.ConstantMsgPolicy.setForwardToSelfFlag | ( | boolean | forwardToSelf | ) |
| forwardToSelf | Whether the policy should forward messages to the queue itself or not |
References forwardToSelf.
| void frodo2.communication.QueueTest.ConstantMsgPolicy.setOutDecision | ( | Decision | outDecision | ) |
| outDecision | the desired output of notifyOut() |
References outDecision.
| void frodo2.communication.QueueTest.ConstantMsgPolicy.setQueue | ( | Queue | queue | ) |
References queue, and queue_lock.
|
private |
Where to forward messages; no forwarding if null.
Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), notifyIn(), and setForward().
|
private |
Whether the policy should forward messages to the queue itself.
Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), notifyIn(), and setForwardToSelfFlag().
|
private |
The list of messages types this listener wants to be notified of.
Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), and getMsgTypes().
|
private |
The output of notifyOut().
Referenced by setOutDecision().
|
private |
Queue from which to call the sendMessage() method when the message must be forwarded.
Referenced by notifyIn(), and setQueue().
|
private |
Lock for queue used for synchronization.
We cannot synchronize directly on queue because it can be null.
Referenced by setQueue().