org.openrdf.sail.helpers
Class NotifyingSailWrapper

java.lang.Object
  extended by org.openrdf.sail.helpers.SailWrapper
      extended by org.openrdf.sail.helpers.NotifyingSailWrapper
All Implemented Interfaces:
NotifyingSail, Sail, StackableSail
Direct Known Subclasses:
DirectTypeHierarchyInferencer, ForwardChainingRDFSInferencer

public class NotifyingSailWrapper
extends SailWrapper
implements NotifyingSail

An implementation of the StackableSail interface that wraps another Sail object and forwards any relevant calls to the wrapped Sail.

Author:
Arjohn Kampman

Constructor Summary
NotifyingSailWrapper()
          Creates a new SailWrapper.
NotifyingSailWrapper(NotifyingSail baseSail)
          Creates a new SailWrapper that wraps the supplied Sail.
 
Method Summary
 void addSailChangedListener(SailChangedListener listener)
          Adds the specified SailChangedListener to receive events when the data in this Sail object changes.
 NotifyingSail getBaseSail()
          Gets the base Sail that this Sail works on top of.
 NotifyingSailConnection getConnection()
          Opens a connection on the Sail which can be used to query and update data.
 void removeSailChangedListener(SailChangedListener listener)
          Removes the specified SailChangedListener so that it no longer receives events from this Sail object.
 void setBaseSail(Sail baseSail)
          Sets the base Sail that this Sail will work on top of.
 
Methods inherited from class org.openrdf.sail.helpers.SailWrapper
getDataDir, getValueFactory, initialize, isWritable, setDataDir, shutDown, verifyBaseSailSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.sail.Sail
getDataDir, getValueFactory, initialize, isWritable, setDataDir, shutDown
 

Constructor Detail

NotifyingSailWrapper

public NotifyingSailWrapper()
Creates a new SailWrapper. The base Sail for the created SailWrapper can be set later using setBaseSail(org.openrdf.sail.Sail).


NotifyingSailWrapper

public NotifyingSailWrapper(NotifyingSail baseSail)
Creates a new SailWrapper that wraps the supplied Sail.

Method Detail

setBaseSail

public void setBaseSail(Sail baseSail)
Description copied from interface: StackableSail
Sets the base Sail that this Sail will work on top of. This method will be called before the initialize() method is called.

Specified by:
setBaseSail in interface StackableSail
Overrides:
setBaseSail in class SailWrapper

getBaseSail

public NotifyingSail getBaseSail()
Description copied from interface: StackableSail
Gets the base Sail that this Sail works on top of.

Specified by:
getBaseSail in interface StackableSail
Overrides:
getBaseSail in class SailWrapper

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 SailWrapper
Throws:
SailException - If no transaction could be started, for example because the Sail is not writable.

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


Copyright © 2001-2008 Aduna. All Rights Reserved.