gr.uoa.di.madgik.commons.channel.events
Class BytePayloadChannelEvent

java.lang.Object
  extended by java.util.Observable
      extended by gr.uoa.di.madgik.commons.channel.events.ChannelStateEvent
          extended by gr.uoa.di.madgik.commons.channel.events.ChannelPayloadStateEvent
              extended by gr.uoa.di.madgik.commons.channel.events.BytePayloadChannelEvent
All Implemented Interfaces:
ISerializable

public class BytePayloadChannelEvent
extends ChannelPayloadStateEvent

Event containing payload that the sender wants to provide to listeners

Author:
gpapanikos

Constructor Summary
BytePayloadChannelEvent()
          Instantiates a new byte payload channel event.
BytePayloadChannelEvent(byte[] Value)
          Instantiates a new byte payload channel event.
 
Method Summary
 void Decode(byte[] payload)
          Decodes the payload of the implementing object as it was returned by ISerializable.Encode()
 byte[] Encode()
          Encodes the payload of the implementing object so that is can later be unmarshaled
 ChannelState.EventName GetEventName()
          Gets the event name.
 java.lang.String GetSerializableClassName()
          Gets the class name of the object being serialized.
 byte[] GetValue()
          Retrieves the contained payload
 void SetValue(byte[] Value)
          Sets the contained payload
 
Methods inherited from class gr.uoa.di.madgik.commons.channel.events.ChannelStateEvent
GetEmitingNozzleID, GetEmitingNozzleIdentifierLeastSignificantBits, GetEmitingNozzleIdentifierMostSignificantBits, NotifyChange, SetEmitingNozzleIdentifierLeastSignificantBits, SetEmitingNozzleIdentifierMostSignificantBits
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytePayloadChannelEvent

public BytePayloadChannelEvent()
Instantiates a new byte payload channel event.


BytePayloadChannelEvent

public BytePayloadChannelEvent(byte[] Value)
Instantiates a new byte payload channel event.

Parameters:
Value - the payload the event contains
Method Detail

GetEventName

public ChannelState.EventName GetEventName()
Description copied from class: ChannelStateEvent
Gets the event name.

Specified by:
GetEventName in class ChannelStateEvent
Returns:
the channel state. event name

GetValue

public byte[] GetValue()
Retrieves the contained payload

Returns:
the payload

SetValue

public void SetValue(byte[] Value)
Sets the contained payload

Parameters:
Value - the payload

GetSerializableClassName

public java.lang.String GetSerializableClassName()
Description copied from interface: ISerializable
Gets the class name of the object being serialized. This name is used to instantiate the object when unmarshaled

Returns:
the class name

Decode

public void Decode(byte[] payload)
            throws java.lang.Exception
Description copied from interface: ISerializable
Decodes the payload of the implementing object as it was returned by ISerializable.Encode()

Parameters:
payload - the serialization
Throws:
java.lang.Exception - the Serialization could not be performed

Encode

public byte[] Encode()
              throws java.lang.Exception
Description copied from interface: ISerializable
Encodes the payload of the implementing object so that is can later be unmarshaled

Returns:
the byte[] the encoded payload
Throws:
java.lang.Exception - The serialization could not be performed