i3.dragos.gm.core.event
Class DataEvent

java.lang.Object
  extended by java.util.EventObject
      extended by i3.dragos.core.services.events.DragosEvent
          extended by i3.dragos.gm.core.event.DataEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GraphEntityClassEvent, GraphEntityEvent

public abstract class DataEvent
extends DragosEvent

DataEvents signal the manipulation of the actual data stored in the database, namely the graph data and the underlying schema.

They are bundled in this abstract super class because they all occur inside transactions, and through this common ancestor can be handled in a uniform way.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
DataListener, EventManager, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DataEvent(GraphEntityClass source, int eventType)
          Constructs a new event.
DataEvent(GraphEntity source, int eventType)
          Constructs a new event.
 
Method Summary
 DataChangeSet getAffectedElements()
          Returns a DataChangeSet of elements affected by this event.
 DataSourceURL getDataSourceURL()
          Returns the DataSourceURL where this event occured.
 
Methods inherited from class i3.dragos.core.services.events.DragosEvent
getEventClass, getEventType, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataEvent

public DataEvent(GraphEntity source,
                 int eventType)
Constructs a new event.

Parameters:
source - The source of this event.
eventType - The type of event.

DataEvent

public DataEvent(GraphEntityClass source,
                 int eventType)
Constructs a new event.

Parameters:
source - The source of this event.
eventType - The type of event.
Method Detail

getDataSourceURL

public DataSourceURL getDataSourceURL()
Returns the DataSourceURL where this event occured.

Returns:
the DataSourceURL where this event occured.

getAffectedElements

public DataChangeSet getAffectedElements()
Returns a DataChangeSet of elements affected by this event.

This method is mainly used by the EventManager to determine which graph entities / graph entity classes need to be marked "dirty".

This list should only contain elements directly affected by the event. Any indirectly affected elements (subclasses, instances...) can be determined later automatically.

The default implementation in DataEvent returns a DataChangeSet that just contains the source of the event.

Returns:
a DataChangeSet of elements affected by this event (may be empty, but never null).


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.