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

A message containing data that must be custom-serialized. More...

Inheritance diagram for frodo2.communication.MessageWithRawData:

Classes

interface  RawDataHandler
 This class is responsible for handling the raw data. More...

Public Member Functions

 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.
abstract void serializeRawData (ObjectOutputStream stream)
 Serializes this message's raw data into the given stream.
ObjectInputStream getRawData ()
abstract void deserializeRawData ()
 Deserializes the raw data by reading it from the output of MessageWithRawData.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.

Protected Member Functions

void finalize () throws Throwable
 Discards the raw data.

Protected Attributes

RawDataHandler handler
 The object used to handle the raw data.
Protected Attributes inherited from frodo2.communication.Message
MessageType type
 The type of this message.

Private Attributes

transient Object rawDataHandler_lock = new Object ()
 Object used to synchronize access to the raw data handler.

Detailed Description

A message containing data that must be custom-serialized.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ MessageWithRawData() [1/2]

frodo2.communication.MessageWithRawData.MessageWithRawData ( )

Empty constructor used for externalization.

◆ MessageWithRawData() [2/2]

frodo2.communication.MessageWithRawData.MessageWithRawData ( MessageType type)

Constructor.

Parameters
typethe type of the message

References frodo2.communication.Message.type.

Member Function Documentation

◆ deserializeRawData()

abstract void frodo2.communication.MessageWithRawData.deserializeRawData ( )
abstract

Deserializes the raw data by reading it from the output of MessageWithRawData.getRawData().

Reimplemented in frodo2.communication.MessageSerializedSimple< T extends Serializable >.

◆ finalize()

void frodo2.communication.MessageWithRawData.finalize ( ) throws Throwable
protected

Discards the raw data.

See also
java.lang.Object#finalize()

References handler.

◆ getHandler()

RawDataHandler frodo2.communication.MessageWithRawData.getHandler ( )
Returns
the raw data handler

References handler, and rawDataHandler_lock.

Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.run().

◆ getRawData()

ObjectInputStream frodo2.communication.MessageWithRawData.getRawData ( )
Returns
the stream from which the raw data can be read

References handler.

Referenced by frodo2.communication.MessageSerializedSimple< T extends Serializable >.deserializeRawData().

◆ readExternal()

void frodo2.communication.MessageWithRawData.readExternal ( ObjectInput in) throws IOException, ClassNotFoundException
See also
Message.readExternal(java.io.ObjectInput)

Reimplemented from frodo2.communication.Message.

◆ serializeRawData()

abstract void frodo2.communication.MessageWithRawData.serializeRawData ( ObjectOutputStream stream)
abstract

Serializes this message's raw data into the given stream.

Parameters
streamoutput stream to which the raw data should be written

Reimplemented in frodo2.communication.MessageSerializedSimple< T extends Serializable >.

Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.RawDataSender.run().

◆ setHandler()

void frodo2.communication.MessageWithRawData.setHandler ( RawDataHandler handler)

Sets the raw data handler for this message.

Parameters
handlerthe handler to set

References handler, and rawDataHandler_lock.

Referenced by frodo2.communication.tcp.QueueOutputPipeTCP.run().

◆ writeExternal()

void frodo2.communication.MessageWithRawData.writeExternal ( ObjectOutput out) throws IOException
See also
Message.writeExternal(java.io.ObjectOutput)

Reimplemented from frodo2.communication.Message.

Member Data Documentation

◆ handler

RawDataHandler frodo2.communication.MessageWithRawData.handler
protected

The object used to handle the raw data.

Referenced by finalize(), getHandler(), getRawData(), and setHandler().

◆ rawDataHandler_lock

transient Object frodo2.communication.MessageWithRawData.rawDataHandler_lock = new Object ()
private

Object used to synchronize access to the raw data handler.

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

Referenced by getHandler(), and setHandler().


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