fulmine.distribution.events
Class MessageEvent

java.lang.Object
  extended by fulmine.event.AbstractEvent
      extended by fulmine.distribution.events.MessageEvent
All Implemented Interfaces:
IEvent, ISystemEvent, IAddressable, IDescriptor, Cloneable

public final class MessageEvent
extends AbstractEvent
implements ISystemEvent

Raised by an IConnection and encapsulates a byte[] message received from a remote IFrameworkContext.

This implementation of an ISystemEvent can be raised by a non- ISystemEventSource. This is so that an IEventListener for an IContainer will not receive these events.

Author:
Ramon Servadei

Constructor Summary
MessageEvent(IConnection connection, byte[] data)
          Standard constructor to wrap the byte[] message from a remote IFrameworkContext
 
Method Summary
protected  String getAdditionalToString()
          Delegate method for subclasses to provide additional toString information.
 byte[] getData()
          Get the byte[] message from the remote context
 String getDataAsString()
          Get the message from the remote context as a string
 String getTraceString()
          Provides a trace string the shows the byte level contents of the data.
 
Methods inherited from class fulmine.event.AbstractEvent
clone, equals, getAddress, getDomain, getDrivingFrame, getFrame, getIdentity, getSource, getTriggerEvent, getType, hashCode, hideSourceFromToString, setAddress, setDrivingFrame, setFrame, setSource, setTriggerEvent, toDetailedString, toIdentityString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fulmine.event.IEvent
clone, getDrivingFrame, getFrame, getSource, getTriggerEvent, setTriggerEvent
 
Methods inherited from interface fulmine.IDescriptor
toDetailedString, toIdentityString
 
Methods inherited from interface fulmine.IAddressable
getAddress, getDomain, getIdentity, getType
 

Constructor Detail

MessageEvent

public MessageEvent(IConnection connection,
                    byte[] data)
Standard constructor to wrap the byte[] message from a remote IFrameworkContext

Parameters:
connection - the connection to the remote context, the source of the data
data - the byte[] message received from a remote context
Method Detail

getData

public byte[] getData()
Get the byte[] message from the remote context

Returns:
a byte[] message from the remote context

getDataAsString

public String getDataAsString()
Get the message from the remote context as a string

Returns:
a string version of the message from the remote context

getTraceString

public String getTraceString()
Provides a trace string the shows the byte level contents of the data. Used for fine grain debugging.

Returns:
a trace string

getAdditionalToString

protected String getAdditionalToString()
Description copied from class: AbstractEvent
Delegate method for subclasses to provide additional toString information. This should be a comma separated string, e.g. "one, two, three"

Overrides:
getAdditionalToString in class AbstractEvent
Returns:
the additional toString information in comma separated format


Copyright © 2007-2009. All Rights Reserved.