FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.communication.MessageSerializedSimple< T extends Serializable > Class Template Reference

A message that has a single object as raw data. More...

Inheritance diagram for frodo2.communication.MessageSerializedSimple< T extends Serializable >:

Public Member Functions

 MessageSerializedSimple ()
 Empty constructor used for externalization.
 MessageSerializedSimple (MessageType type, T data)
 Constructor.
synchronized void serializeRawData (ObjectOutputStream output)
 Writes this message's raw data to the provided output stream.
synchronized void deserializeRawData ()
 Reads an object of class T from the stream of raw data and stores it in data.
getData ()
Public Member Functions inherited from frodo2.communication.MessageWithRawData
 MessageWithRawData ()
 Empty constructor used for externalization.
void writeExternal (ObjectOutput out) throws IOException
void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
 MessageWithRawData (MessageType type)
 Constructor.
RawDataHandler getHandler ()
void setHandler (RawDataHandler handler)
 Sets the raw data handler for this message.
ObjectInputStream getRawData ()
Public Member Functions inherited from frodo2.communication.Message
 Message (MessageType type)
 Constructor.
 Message ()
 Empty constructor.
MessageType getType ()
String toString ()
void fakeSerialize ()
 Pretends to serialize the message.

Private Member Functions

void setData (T data)

Private Attributes

transient T data = null
 The data that is going to be (de)serialized.
transient Object data_lock = new Object ()
 Object used to synchronize the access to data.

Additional Inherited Members

Protected Member Functions inherited from frodo2.communication.MessageWithRawData
void finalize () throws Throwable
 Discards the raw data.
Protected Attributes inherited from frodo2.communication.MessageWithRawData
RawDataHandler handler
 The object used to handle the raw data.
Protected Attributes inherited from frodo2.communication.Message
MessageType type
 The type of this message.

Detailed Description

A message that has a single object as raw data.

This class is provided for convenience, and as an example of how to extend the Message class.

Author
Thomas Leaute
Parameters
<T>the class of the object passed as raw data

Constructor & Destructor Documentation

◆ MessageSerializedSimple() [1/2]

Empty constructor used for externalization.

References data_lock.

◆ MessageSerializedSimple() [2/2]

Constructor.

Parameters
typetype of this message
datathe raw data

References data, and frodo2.communication.Message.type.

Member Function Documentation

◆ deserializeRawData()

synchronized void frodo2.communication.MessageSerializedSimple< T extends Serializable >.deserializeRawData ( )

◆ getData()

◆ serializeRawData()

synchronized void frodo2.communication.MessageSerializedSimple< T extends Serializable >.serializeRawData ( ObjectOutputStream output)

Writes this message's raw data to the provided output stream.

See also
MessageWithRawData.serializeRawData(ObjectOutputStream)

Reimplemented from frodo2.communication.MessageWithRawData.

References data, data_lock, and frodo2.output.

◆ setData()

void frodo2.communication.MessageSerializedSimple< T extends Serializable >.setData ( T data)
private
Parameters
datathe new value of the data

References data, and data_lock.

Referenced by deserializeRawData().

Member Data Documentation

◆ data

transient T frodo2.communication.MessageSerializedSimple< T extends Serializable >.data = null
private

The data that is going to be (de)serialized.

Referenced by deserializeRawData(), getData(), MessageSerializedSimple(), serializeRawData(), and setData().

◆ data_lock

transient Object frodo2.communication.MessageSerializedSimple< T extends Serializable >.data_lock = new Object ()
private

Object used to synchronize the access to data.

We cannot synchronize directly over data because it can be null.

Referenced by deserializeRawData(), getData(), MessageSerializedSimple(), serializeRawData(), and setData().


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