FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.communication.QueueTest.ConstantMsgPolicy Class Reference

A message policy that always returns the same decision. More...

Inheritance diagram for frodo2.communication.QueueTest.ConstantMsgPolicy:

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< MessageTypegetMsgTypes ()
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< MessageTypemsgTypes = new ArrayList <MessageType> ()
 The list of messages types this listener wants to be notified of.

Detailed Description

A message policy that always returns the same decision.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ ConstantMsgPolicy() [1/2]

frodo2.communication.QueueTest.ConstantMsgPolicy.ConstantMsgPolicy ( String forward,
boolean forwardToSelf )

Constructor.

By default, it listens to messages of type MessageType.ROOT_TYPE.

Parameters
forwardWhere to forward messages; no forwarding if null
forwardToSelfWhether the policy should forward messages to the queue itself

References forward, forwardToSelf, msgTypes, and frodo2.communication.MessageType.ROOT.

◆ ConstantMsgPolicy() [2/2]

frodo2.communication.QueueTest.ConstantMsgPolicy.ConstantMsgPolicy ( String forward,
boolean forwardToSelf,
MessageType msgType )

Constructor.

Parameters
forwardWhere to forward messages; no forwarding if null
forwardToSelfWhether the policy should forward messages to the queue itself
msgTypethe type of messages this listens to

References forward, forwardToSelf, and msgTypes.

Member Function Documentation

◆ getMsgTypes()

Collection< MessageType > frodo2.communication.QueueTest.ConstantMsgPolicy.getMsgTypes ( )

◆ notifyIn()

void frodo2.communication.QueueTest.ConstantMsgPolicy.notifyIn ( Message msg)

◆ notifyOut()

Decision frodo2.communication.QueueTest.ConstantMsgPolicy.notifyOut ( Message msg)
See also
OutgoingMsgPolicyInterface.notifyOut(Message)
Returns
always DISCARD.

◆ setForward()

void frodo2.communication.QueueTest.ConstantMsgPolicy.setForward ( String forward)
Parameters
forwardWhere to forward messages; no forwarding if null

References forward.

Referenced by frodo2.communication.QueueTest.testDiscard(), and frodo2.communication.QueueTest.testForwardByType().

◆ setForwardToSelfFlag()

void frodo2.communication.QueueTest.ConstantMsgPolicy.setForwardToSelfFlag ( boolean forwardToSelf)
Parameters
forwardToSelfWhether the policy should forward messages to the queue itself or not

References forwardToSelf.

◆ setOutDecision()

void frodo2.communication.QueueTest.ConstantMsgPolicy.setOutDecision ( Decision outDecision)
Parameters
outDecisionthe desired output of notifyOut()

References outDecision.

◆ setQueue()

void frodo2.communication.QueueTest.ConstantMsgPolicy.setQueue ( Queue queue)

Member Data Documentation

◆ forward

String frodo2.communication.QueueTest.ConstantMsgPolicy.forward
private

Where to forward messages; no forwarding if null.

Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), notifyIn(), and setForward().

◆ forwardToSelf

Boolean frodo2.communication.QueueTest.ConstantMsgPolicy.forwardToSelf
private

Whether the policy should forward messages to the queue itself.

Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), notifyIn(), and setForwardToSelfFlag().

◆ msgTypes

ArrayList<MessageType> frodo2.communication.QueueTest.ConstantMsgPolicy.msgTypes = new ArrayList <MessageType> ()
private

The list of messages types this listener wants to be notified of.

Referenced by ConstantMsgPolicy(), ConstantMsgPolicy(), and getMsgTypes().

◆ outDecision

Decision frodo2.communication.QueueTest.ConstantMsgPolicy.outDecision = Decision.DONTCARE
private

The output of notifyOut().

Referenced by setOutDecision().

◆ queue

Queue frodo2.communication.QueueTest.ConstantMsgPolicy.queue
private

Queue from which to call the sendMessage() method when the message must be forwarded.

Referenced by notifyIn(), and setQueue().

◆ queue_lock

Object frodo2.communication.QueueTest.ConstantMsgPolicy.queue_lock = new Object()
private

Lock for queue used for synchronization.

We cannot synchronize directly on queue because it can be null.

Referenced by setQueue().


The documentation for this class was generated from the following file: