org.ikasan.framework.component
Class Event

java.lang.Object
  extended by org.ikasan.framework.component.Event
All Implemented Interfaces:
Cloneable

public class Event
extends Object
implements Cloneable

Event provides the transport framing object for all payloads and associated data across synchronous hops ie JMS -> JMS.

Author:
Ikasan Development Team

Constructor Summary
Event(String id, int priority, Date timestamp, List<Payload> payloads)
          Constructor for reconstituting Events To be used only for reconstitution of previously serialised Events.
Event(String originatingModuleName, String originatingComponentName, String originatorGeneratedId, List<Payload> payloads)
          Constructor for new Events To be used only for origination of new Events.
Event(String originatingModuleName, String originatingComponentName, String originatorGeneratedId, Payload payload)
          Constructor for new Events To be used only for origination of new Events.
 
Method Summary
 Event clone()
          Returns a completely new instance of the payload with a deep copy of all fields.
 String getFormattedTimestamp(DateFormat dateFormat)
          Retrieves a String representation of the timestamp using the DateFormat provided
 String getId()
          Accessor for id
 List<Payload> getPayloads()
          Returns a list of payloads.
 Long getPersistenceId()
          Accessor for persistenceId
 int getPriority()
          Accessor for priority
 Date getTimestamp()
          Accessor for timestamp
 String idToString()
          Create a formatted string detailing the event id and associated payload id(s).
 void setPayloads(List<Payload> payloadList)
          Sets payload list.
 void setPriority(int priority)
          Mutator for priority
 Event spawnChild(String moduleName, String componentName, int siblingNo, List<Payload> payloads)
          Spawns a new child Event from this Event
 Event spawnChild(String moduleName, String componentName, int siblingNo, Payload payload)
          Spawns a new child Event from this Event
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Event

public Event(String originatingModuleName,
             String originatingComponentName,
             String originatorGeneratedId,
             List<Payload> payloads)
Constructor for new Events To be used only for origination of new Events. Not to used for deserialising serialised Events

Parameters:
originatingModuleName -
originatingComponentName -
originatorGeneratedId -
payloads -

Event

public Event(String originatingModuleName,
             String originatingComponentName,
             String originatorGeneratedId,
             Payload payload)
Constructor for new Events To be used only for origination of new Events. Not to used for deserialising serialised Events

Parameters:
originatingModuleName -
originatingInitiatorName -
initiatorGeneratedId -
payload -

Event

public Event(String id,
             int priority,
             Date timestamp,
             List<Payload> payloads)
Constructor for reconstituting Events To be used only for reconstitution of previously serialised Events. Not to used for originating new Events

Parameters:
id -
priority -
timestamp -
paylaods -
Method Detail

clone

public Event clone()
            throws CloneNotSupportedException
Returns a completely new instance of the payload with a deep copy of all fields. Note the subtle difference in comparison with spawn() which changes some field values to reflect a newly created instance.

Overrides:
clone in class Object
Returns:
cloned Event
Throws:
CloneNotSupportedException

idToString

public String idToString()
Create a formatted string detailing the event id and associated payload id(s).

Returns:
String - formatted messsage

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
String representation of Event

spawnChild

public Event spawnChild(String moduleName,
                        String componentName,
                        int siblingNo,
                        List<Payload> payloads)
Spawns a new child Event from this Event

Parameters:
moduleName -
componentName -
siblingNo -
payloads -
Returns:

spawnChild

public Event spawnChild(String moduleName,
                        String componentName,
                        int siblingNo,
                        Payload payload)
Spawns a new child Event from this Event

Parameters:
moduleName -
componentName -
siblingNo -
payload -
Returns:

getId

public String getId()
Accessor for id

Returns:

getTimestamp

public Date getTimestamp()
Accessor for timestamp

Returns:
timestamp

getFormattedTimestamp

public String getFormattedTimestamp(DateFormat dateFormat)
Retrieves a String representation of the timestamp using the DateFormat provided

Parameters:
dateFormat -
Returns:

getPriority

public int getPriority()
Accessor for priority

Returns:
priority

setPriority

public void setPriority(int priority)
Mutator for priority

Parameters:
priority -

setPayloads

public void setPayloads(List<Payload> payloadList)
Sets payload list.

Parameters:
payloadList -

getPayloads

public List<Payload> getPayloads()
Returns a list of payloads.

Returns:
payload as an ArrayList

getPersistenceId

public Long getPersistenceId()
Accessor for persistenceId

Returns:
persistenceId if set


Copyright © 2007-2012 Ikasan. All Rights Reserved.