Class AsynchMessageManager
java.lang.Object
utils.communication.communicationHandler.AsynchMessageManager
- All Implemented Interfaces:
CommunicationManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToGroup
(AddressInterface address, ProcessInterface process) Add a new process to the group, identified by its addressorg.javatuples.Triplet<AddressInterface,
byte[], Byte> dequeue
(Subscription acceptableTypesSubscription) Dequeue a message tagged with any of the wanted types.Get the object that defines the communication groupgetRegistration
(Collection<Byte> acceptableTypes) Register a new group of types of messages that this manager should keep track of.getRegistration
(Collection<Byte> acceptableTypes, InstanceID instanceID) Register a new group of types of messages that this manager shoudl keep track of, associated to a specific InstanceID.void
open()
-
Constructor Details
-
AsynchMessageManager
-
-
Method Details
-
getRegistration
Description copied from interface:CommunicationManager
Register a new group of types of messages that this manager should keep track of. If any of the types are already registered, then no valid registration is made.- Specified by:
getRegistration
in interfaceCommunicationManager
- Parameters:
acceptableTypes
- Set containing the wanted message types.- Returns:
- New registration. If no valid registration was made, then it should return NULL.
-
getRegistration
Description copied from interface:CommunicationManager
Register a new group of types of messages that this manager shoudl keep track of, associated to a specific InstanceID. If this instanceID already has a registration, then no new registration is made. If any of the new message types are present in a previous registration, as long as the instanceID is new, then a new valid registration must be produced.- Specified by:
getRegistration
in interfaceCommunicationManager
- Parameters:
acceptableTypes
- Set containing the wanted message typesinstanceID
- Object defining a unique identifier for the insterested subscriber.- Returns:
- New registration. If no valid registration was made, then it should return NULL.
-
open
public void open() -
dequeue
public org.javatuples.Triplet<AddressInterface,byte[], dequeueByte> (Subscription acceptableTypesSubscription) Description copied from interface:CommunicationManager
Dequeue a message tagged with any of the wanted types. If no such message exists, the method should block until one is available.- Specified by:
dequeue
in interfaceCommunicationManager
- Parameters:
acceptableTypesSubscription
- Subscription defining the wanted types- Returns:
- Triplet containing the address of the sender, the payload of the message, and the actual type of the message
-
addToGroup
Description copied from interface:CommunicationManager
Add a new process to the group, identified by its address- Specified by:
addToGroup
in interfaceCommunicationManager
- Parameters:
address
- Address of the processprocess
- Actual process
-
getGroupConstitution
Description copied from interface:CommunicationManager
Get the object that defines the communication group- Specified by:
getGroupConstitution
in interfaceCommunicationManager
- Returns:
- the group constitution object
-