fulmine.event
Class AbstractEvent

java.lang.Object
  extended by fulmine.event.AbstractEvent
All Implemented Interfaces:
IEvent, IAddressable, IDescriptor, Cloneable
Direct Known Subclasses:
AbstractContainerFieldEvent, AbstractSystemEvent, AsymmetricEventProcessor.Result, ContainerStateChangeEvent, MessageConsumedEvent, MessageEvent, RxEvent, TxEvent

public abstract class AbstractEvent
extends Object
implements IEvent

Base-class for IEvent instances that are marker events. A marker event represents an arbitrary event and is not necessarily related to the state of its IEventSource. Therefore marker events cannot be coalesced and thus the equals(Object) and hashCode() methods are final and perform the standard operation exposed by the Object class.

Author:
Ramon Servadei

Constructor Summary
AbstractEvent()
          Public constructor
 
Method Summary
 Object clone()
          Clone this.
 boolean equals(Object obj)
           
protected  String getAdditionalToString()
          Delegate method for subclasses to provide additional toString information.
 String getAddress()
          Get the unique address for this.
 IDomain getDomain()
          Get the domain attribute of this object.
 IEventFrameExecution getDrivingFrame()
          Get the event frame execution that directly caused this event to occur.
 IEventFrameExecution getFrame()
          Get the event frame of this event.
 String getIdentity()
          Get the identification string for this entity.
 IEventSource getSource()
          Get the event source that generated this event
 IEvent getTriggerEvent()
          Get the 'trigger event'.
 IType getType()
          Get the type attribute of this object.
 int hashCode()
           
protected  boolean hideSourceFromToString()
          Allows sub-classes the ability to hide the source attribute from the toString() calls.
protected  void setAddress(IAddressable address)
           
 void setDrivingFrame(IEventFrameExecution drivingFrame)
           
 void setFrame(IEventFrameExecution frame)
           
 void setSource(IEventSource source)
           
 void setTriggerEvent(IEvent triggerEvent)
          Set the 'trigger event'.
 String toDetailedString()
          Provides a formatted string describing this object in detail.
 String toIdentityString()
          Get a string that provides the identification for this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEvent

public AbstractEvent()
Public constructor

Method Detail

getDrivingFrame

public final IEventFrameExecution getDrivingFrame()
Description copied from interface: IEvent
Get the event frame execution that directly caused this event to occur.

An event occurs in its own event frame but it may have been caused by an event from another frame. This other frame is known as the 'driving' frame and directly causes this event. In this paradigm, where one event can cause another event to occur but in a separate event frame execution, it is sometimes necessary to know the frame of the first event so that the 2 events can be linked together.

Specified by:
getDrivingFrame in interface IEvent
Returns:
an IEventFrameExecution that is the event frame execution of the event that caused this event to occur.

getFrame

public final IEventFrameExecution getFrame()
Description copied from interface: IEvent
Get the event frame of this event.

Specified by:
getFrame in interface IEvent
Returns:
the IEventFrameExecution that identifies the frame this event occurred in.

getSource

public final IEventSource getSource()
Description copied from interface: IEvent
Get the event source that generated this event

Specified by:
getSource in interface IEvent
Returns:
the source that generated the event

setSource

public final void setSource(IEventSource source)

setAddress

protected final void setAddress(IAddressable address)

setFrame

public void setFrame(IEventFrameExecution frame)

setDrivingFrame

public void setDrivingFrame(IEventFrameExecution drivingFrame)

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: IEvent
Clone this.

Specified by:
clone in interface IEvent
Overrides:
clone in class Object
Returns:
a clone of this
Throws:
CloneNotSupportedException
See Also:
Object#clone)_

toDetailedString

public String toDetailedString()
Description copied from interface: IDescriptor
Provides a formatted string describing this object in detail. This has the same or more information than the standard Object.toString() method.

Specified by:
toDetailedString in interface IDescriptor
Returns:
a formatted string describing this object in detail

toIdentityString

public String toIdentityString()
Description copied from interface: IDescriptor
Get a string that provides the identification for this object. This should have no more detail than the Object.toString() method.

Specified by:
toIdentityString in interface IDescriptor
Returns:
a string that provides the identification for this object

getDomain

public final IDomain getDomain()
Description copied from interface: IAddressable
Get the domain attribute of this object. The domain is orthogonal to the type.

Specified by:
getDomain in interface IAddressable
Returns:
the domain of this object
See Also:
IAddressable.getType()

getIdentity

public final String getIdentity()
Description copied from interface: IAddressable
Get the identification string for this entity. This is unique within the type and domain.

Specified by:
getIdentity in interface IAddressable
Returns:
a String identity providing an identification for this entity within its type and domain.
See Also:
IAddressable.getType(), IAddressable.getDomain()

getType

public final IType getType()
Description copied from interface: IAddressable
Get the type attribute of this object. The type is orthogonal to the domain.

Specified by:
getType in interface IAddressable
Returns:
the type of this object
See Also:
IAddressable.getDomain()

getAddress

public final String getAddress()
Description copied from interface: IAddressable
Get the unique address for this. The address is composed of the identity, domain and type.

Specified by:
getAddress in interface IAddressable
Returns:
the unique address for this

setTriggerEvent

public void setTriggerEvent(IEvent triggerEvent)
Description copied from interface: IEvent
Set the 'trigger event'. This is an event that is added to the context's IEventManager queue after this event has been processed.

Specified by:
setTriggerEvent in interface IEvent
Parameters:
triggerEvent - the trigger event that will be queued after this event has been processed.

getTriggerEvent

public IEvent getTriggerEvent()
Description copied from interface: IEvent
Get the 'trigger event'. This is an event that is added to the context's IEventManager queue after this event has been processed.

Specified by:
getTriggerEvent in interface IEvent
Returns:
the trigger event to queue after this event has been processed, or null if there is not a trigger event.

getAdditionalToString

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

Returns:
the additional toString information in comma separated format

hideSourceFromToString

protected boolean hideSourceFromToString()
Allows sub-classes the ability to hide the source attribute from the toString() calls.

Returns:
true if the source attribute should not be shown in string representations. Default is false.

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2009. All Rights Reserved.