com.dxfeed.event.misc
Class Message

java.lang.Object
  extended by com.dxfeed.event.misc.Message
All Implemented Interfaces:
Serializable

@EventType
public final class Message
extends Object
implements Serializable

Message event with application-specific attachment.

See Also:
Serialized Form

Constructor Summary
Message()
          Creates new message with default values.
Message(String eventSymbol)
          Creates new message with the specified event symbol.
Message(String eventSymbol, Object attachment)
          Creates new message with the specified event symbol and attachment.
 
Method Summary
 Object getAttachment()
          Returns attachment.
 Object getAttachment(ClassLoader cl)
          Returns attachment.
 String getEventSymbol()
          Returns symbol for this event.
 Object getMarshalledAttachment()
          Returns implementation-specific form of an attachment.
 void setAttachment(Object attachment)
          Changes attachment.
 void setEventSymbol(String eventSymbol)
          Changes symbol for this event.
 void setMarshalledAttachment(Object attachment)
          Changes implementation-specific form of an attachment.
 String toString()
          Returns string representation of this message event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Creates new message with default values.


Message

public Message(String eventSymbol)
Creates new message with the specified event symbol.

Parameters:
eventSymbol - event symbol.

Message

public Message(String eventSymbol,
               Object attachment)
Creates new message with the specified event symbol and attachment.

Parameters:
eventSymbol - event symbol.
attachment - attachment.
Method Detail

getEventSymbol

public String getEventSymbol()
Returns symbol for this event.


setEventSymbol

public void setEventSymbol(String eventSymbol)
Changes symbol for this event.

Parameters:
eventSymbol - event symbol.

getAttachment

public Object getAttachment()
Returns attachment.

Throws:
RuntimeException - if object cannot be deserialized from its serial form

getAttachment

public Object getAttachment(ClassLoader cl)
Returns attachment.

Parameters:
cl - the ClassLoader that will be used to load classes; null for default
Throws:
RuntimeException - if object cannot be deserialized from its serial form

setAttachment

public void setAttachment(Object attachment)
Changes attachment.

Parameters:
attachment - attachment.

getMarshalledAttachment

public Object getMarshalledAttachment()
Returns implementation-specific form of an attachment. Do not use this method directly. It may be removed or changed in the future versions.


setMarshalledAttachment

public void setMarshalledAttachment(Object attachment)
Changes implementation-specific form of an attachment. Do not use this method directly. It may be removed or changed in the future versions.

Parameters:
attachment - implementation-specific form of an attachment.

toString

public String toString()
Returns string representation of this message event.

Overrides:
toString in class Object


Copyright © 2013 Devexperts. All Rights Reserved.