org.keridwen.core.messaging.internal
Class DefaultEvent<ResultType,MessageType>

java.lang.Object
  extended by org.keridwen.core.messaging.internal.DefaultEvent<ResultType,MessageType>
Type Parameters:
ResultType - type of the value returned by the Command.
MessageType - the type of the message transported by the Event
All Implemented Interfaces:
Event<ResultType,MessageType>

public class DefaultEvent<ResultType,MessageType>
extends Object
implements Event<ResultType,MessageType>

This is the default implementation of the Event interface.


Constructor Summary
DefaultEvent(EventKey anEventKey, MessageType aMessage)
          Builds an Event with the given unique EventKey and a message to transport.
DefaultEvent(EventKey anEventKey, MessageType aMessage, Object aSource)
          Builds an Event with the given unique EventKey and a message to transport.
DefaultEvent(EventKey anEventKey, MessageType aMessage, Object aSource, BundleController aDestination)
          Builds an Event with the given unique EventKey and a message to transport.
 
Method Summary
 BundleController getDestination()
          Gets the BundleController to which this Event should be sent (if known).
 EventKey getKey()
          Returns the unique EventKey of this Event.
 MessageType getMessage()
          Gets the message transmitted with by the Event.
 Object getSource()
          Gets the sender of the Event.
 Supervisor<ResultType> getSupervisor()
          Gets the supervisor of the associated Command.
 void setMessage(MessageType aMessage)
          Sets the message of the Event.
 void setSupervisor(Supervisor<ResultType> aSupervisor)
          Sets the supervisor of the associated Command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEvent

public DefaultEvent(EventKey anEventKey,
                    MessageType aMessage)
Builds an Event with the given unique EventKey and a message to transport.

Parameters:
anEventKey - the unique event key of the event
aMessage - the message to transport

DefaultEvent

public DefaultEvent(EventKey anEventKey,
                    MessageType aMessage,
                    Object aSource)
Builds an Event with the given unique EventKey and a message to transport.

Parameters:
anEventKey - the unique event key of the event
aMessage - the message to transport
aSource - the emitter of the message

DefaultEvent

public DefaultEvent(EventKey anEventKey,
                    MessageType aMessage,
                    Object aSource,
                    BundleController aDestination)
Builds an Event with the given unique EventKey and a message to transport.

Parameters:
anEventKey - the unique event key of the event
aMessage - the message to transport
aSource - the emitter of the message
aDestination - the controlleron which the event should be executed
Method Detail

getKey

public final EventKey getKey()
Description copied from interface: Event
Returns the unique EventKey of this Event.

Specified by:
getKey in interface Event<ResultType,MessageType>
Returns:
the unique Id of the Event

getMessage

public final MessageType getMessage()
Description copied from interface: Event
Gets the message transmitted with by the Event.

Specified by:
getMessage in interface Event<ResultType,MessageType>
Returns:
the message of the Event

setMessage

public final void setMessage(MessageType aMessage)
Description copied from interface: Event
Sets the message of the Event.

Specified by:
setMessage in interface Event<ResultType,MessageType>
Parameters:
aMessage - the message to set.

getDestination

public final BundleController getDestination()
Description copied from interface: Event
Gets the BundleController to which this Event should be sent (if known).

Specified by:
getDestination in interface Event<ResultType,MessageType>
Returns:
the BundleController that should process this Event.

getSource

public final Object getSource()
Description copied from interface: Event
Gets the sender of the Event.

Specified by:
getSource in interface Event<ResultType,MessageType>
Returns:
the object sending the Event.

getSupervisor

public final Supervisor<ResultType> getSupervisor()
Description copied from interface: Event
Gets the supervisor of the associated Command.

Specified by:
getSupervisor in interface Event<ResultType,MessageType>
Returns:
the event supervisor.

setSupervisor

public final void setSupervisor(Supervisor<ResultType> aSupervisor)
Description copied from interface: Event
Sets the supervisor of the associated Command.

Specified by:
setSupervisor in interface Event<ResultType,MessageType>
Parameters:
aSupervisor - the command supervisor


Copyright © 2010-2013 Artenum. All Rights Reserved.