org.openanzo.model.event
Class AccumulatingEventManager

java.lang.Object
  extended by org.openanzo.model.event.AccumulatingEventManager
All Implemented Interfaces:
INamedGraphEventManager

public class AccumulatingEventManager
extends java.lang.Object
implements INamedGraphEventManager

This event manager keeps track of the changes that take place during a transaction or replication, and batches the changes so that clients can choose to process the changes as a whole, instead of individual events.

Author:
Christopher R. Vincent, Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
AccumulatingEventManager(INamedGraph parentGraph)
          Create a new event manager for a NamedGraph
 
Method Summary
 boolean listening()
          Return true if there are listeners
 void notifyAddStatements(org.openrdf.model.Statement... statements)
          Notify listeners that statements where added
 void notifyDeleteStatements(org.openrdf.model.Statement... statements)
          Notify listeners that statements where deleted
 void notifyEvent(IEvent event)
          Keep track of transactions and replication events in order to batch changes
 void registerListener(INamedGraphListener listener)
          Register a listener
 void unregisterListener(INamedGraphListener listener)
          Unregister a listener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccumulatingEventManager

public AccumulatingEventManager(INamedGraph parentGraph)
Create a new event manager for a NamedGraph

Parameters:
parentGraph - source of event
Method Detail

registerListener

public void registerListener(INamedGraphListener listener)
Register a listener

Specified by:
registerListener in interface INamedGraphEventManager
Parameters:
listener - INamedGraphListener to register

unregisterListener

public void unregisterListener(INamedGraphListener listener)
Unregister a listener

Specified by:
unregisterListener in interface INamedGraphEventManager
Parameters:
listener - INamedGraphListener to unregister

listening

public boolean listening()
Return true if there are listeners

Returns:
true if there are listeners

notifyEvent

public void notifyEvent(IEvent event)
Keep track of transactions and replication events in order to batch changes

Specified by:
notifyEvent in interface INamedGraphEventManager
Parameters:
event - Event to which listeners should be notified

notifyAddStatements

public void notifyAddStatements(org.openrdf.model.Statement... statements)
Description copied from interface: INamedGraphEventManager
Notify listeners that statements where added

Specified by:
notifyAddStatements in interface INamedGraphEventManager
Parameters:
statements - Added statements to which listeners should be notified

notifyDeleteStatements

public void notifyDeleteStatements(org.openrdf.model.Statement... statements)
Description copied from interface: INamedGraphEventManager
Notify listeners that statements where deleted

Specified by:
notifyDeleteStatements in interface INamedGraphEventManager
Parameters:
statements - Deleted statements to which listeners should be notified


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.