fulmine.event.system
Class AbstractSystemEvent

java.lang.Object
  extended by fulmine.event.AbstractEvent
      extended by fulmine.event.system.AbstractSystemEvent
All Implemented Interfaces:
IEvent, ISystemEvent, IAddressable, IDescriptor, Cloneable
Direct Known Subclasses:
ChannelDestroyedEvent, ChannelReadyEvent, ConnectionAvailableEvent, ConnectionDestroyedEvent, ContainerCreatedEvent, ContainerDestroyedEvent, ContextDiscoveredEvent, ContextNotAvailableEvent, EventSourceNotObservedEvent, EventSourceObservedEvent, RemoteContainerCreatedEvent, RemoteContainerDestroyedEvent, RpcInvokeEvent, SendRpcEvent, SubscribeEvent, UnsubscribeEvent

public class AbstractSystemEvent
extends AbstractEvent
implements ISystemEvent

Base class for ISystemEvent instances.

Note that it is not a good idea to have multiple levels of inheritance for system events. All true system events should only extend this and should not be further extended. This is to prevent logic bugs with any code that does instanceof checks on an event type. Events should not extend each other unless there is a genuine semantic meaning for the inheritance. The drawback is that events with similar internal constructs have to be re-written each time.

Author:
Ramon Servadei

Constructor Summary
  AbstractSystemEvent(IEventManager context)
          Create a system event
protected AbstractSystemEvent(IEventManager context, IAddressable address)
          Create a system event with a specific address
 
Method Summary
protected  String getAdditionalToString()
          Delegate method for subclasses to provide additional toString information.
protected  boolean hideSourceFromToString()
          Allows sub-classes the ability to hide the source attribute from the AbstractEvent.toString() calls.
 
Methods inherited from class fulmine.event.AbstractEvent
clone, equals, getAddress, getDomain, getDrivingFrame, getFrame, getIdentity, getSource, getTriggerEvent, getType, hashCode, 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

AbstractSystemEvent

public AbstractSystemEvent(IEventManager context)
Create a system event

Parameters:
context - the context for the ISystemEventSource that generates this event

AbstractSystemEvent

protected AbstractSystemEvent(IEventManager context,
                              IAddressable address)
Create a system event with a specific address

Parameters:
context - the context for the ISystemEventSource that generates this event
address - the IAddressable for this event
Method Detail

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

hideSourceFromToString

protected boolean hideSourceFromToString()
Description copied from class: AbstractEvent
Allows sub-classes the ability to hide the source attribute from the AbstractEvent.toString() calls.

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


Copyright © 2007-2009. All Rights Reserved.