org.openrdf.sail.helpers
Class NotifyingSailBase

java.lang.Object
  extended by org.openrdf.sail.helpers.SailBase
      extended by org.openrdf.sail.helpers.NotifyingSailBase
All Implemented Interfaces:
NotifyingSail, Sail
Direct Known Subclasses:
MemoryStore, NativeStore

public abstract class NotifyingSailBase
extends SailBase
implements NotifyingSail

SailBase is an abstract Sail implementation that takes care of common sail tasks, including proper closing of active connections and a grace period for active connections during shutdown of the store.

Author:
Herko ter Horst, jeen, Arjohn Kampman

Field Summary
 
Fields inherited from class org.openrdf.sail.helpers.SailBase
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, initializationLock, logger
 
Constructor Summary
NotifyingSailBase()
           
 
Method Summary
 void addSailChangedListener(SailChangedListener listener)
          Adds the specified SailChangedListener to receive events when the data in this Sail object changes.
 NotifyingSailConnection getConnection()
          Opens a connection on the Sail which can be used to query and update data.
protected abstract  NotifyingSailConnection getConnectionInternal()
          Returns a store-specific SailConnection object.
 void notifySailChanged(SailChangedEvent event)
          Notifies all registered SailChangedListener's of changes to the contents of this Sail.
 void removeSailChangedListener(SailChangedListener listener)
          Removes the specified SailChangedListener so that it no longer receives events from this Sail object.
 
Methods inherited from class org.openrdf.sail.helpers.SailBase
connectionClosed, debugEnabled, getDataDir, initialize, initializeInternal, isInitialized, setDataDir, shutDown, shutDownInternal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openrdf.sail.Sail
getDataDir, getValueFactory, initialize, isWritable, setDataDir, shutDown
 

Constructor Detail

NotifyingSailBase

public NotifyingSailBase()
Method Detail

getConnection

public NotifyingSailConnection getConnection()
                                      throws SailException
Description copied from interface: Sail
Opens a connection on the Sail which can be used to query and update data. Depending on how the implementation handles concurrent access, a call to this method might block when there is another open connection on this Sail.

Specified by:
getConnection in interface NotifyingSail
Specified by:
getConnection in interface Sail
Overrides:
getConnection in class SailBase
Throws:
SailException - If no transaction could be started, for example because the Sail is not writable.

getConnectionInternal

protected abstract NotifyingSailConnection getConnectionInternal()
                                                          throws SailException
Description copied from class: SailBase
Returns a store-specific SailConnection object.

Specified by:
getConnectionInternal in class SailBase
Returns:
A connection to the store.
Throws:
SailException

addSailChangedListener

public void addSailChangedListener(SailChangedListener listener)
Description copied from interface: NotifyingSail
Adds the specified SailChangedListener to receive events when the data in this Sail object changes.

Specified by:
addSailChangedListener in interface NotifyingSail

removeSailChangedListener

public void removeSailChangedListener(SailChangedListener listener)
Description copied from interface: NotifyingSail
Removes the specified SailChangedListener so that it no longer receives events from this Sail object.

Specified by:
removeSailChangedListener in interface NotifyingSail

notifySailChanged

public void notifySailChanged(SailChangedEvent event)
Notifies all registered SailChangedListener's of changes to the contents of this Sail.



Copyright © 2001-2012 Aduna. All Rights Reserved.