Package org.eclipse.rdf4j.sail.helpers
Class AbstractNotifyingSail
- java.lang.Object
-
- org.eclipse.rdf4j.sail.helpers.AbstractSail
-
- org.eclipse.rdf4j.sail.helpers.AbstractNotifyingSail
-
- All Implemented Interfaces:
NotifyingSail,Sail
- Direct Known Subclasses:
ExtensibleStore,LmdbStore,MemoryStore,NativeStore
public abstract class AbstractNotifyingSail extends AbstractSail implements NotifyingSail
A baseNotifyingSailimplementation 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.eclipse.rdf4j.sail.helpers.AbstractSail
connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_ITERATION_SYNC_THRESHOLD, initializationLock
-
-
Constructor Summary
Constructors Constructor Description AbstractNotifyingSail()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddSailChangedListener(SailChangedListener listener)Adds the specified SailChangedListener to receive events when the data in this Sail object changes.NotifyingSailConnectiongetConnection()Opens a connection on the Sail which can be used to query and update data.protected abstract NotifyingSailConnectiongetConnectionInternal()Returns a store-specific SailConnection object.voidnotifySailChanged(SailChangedEvent event)Notifies all registered SailChangedListener's of changes to the contents of this Sail.voidremoveSailChangedListener(SailChangedListener listener)Removes the specified SailChangedListener so that it no longer receives events from this Sail object.-
Methods inherited from class org.eclipse.rdf4j.sail.helpers.AbstractSail
addSupportedIsolationLevel, connectionClosed, debugEnabled, getDataDir, getDefaultIsolationLevel, getIterationCacheSyncThreshold, getSupportedIsolationLevels, init, initializeInternal, isInitialized, isTrackResultSize, removeSupportedIsolationLevel, setConnectionTimeOut, setDataDir, setDefaultIsolationLevel, setIterationCacheSyncThreshold, setSupportedIsolationLevels, setSupportedIsolationLevels, setTrackResultSize, 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.eclipse.rdf4j.sail.Sail
getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, getValueFactory, init, isWritable, setDataDir, shutDown
-
-
-
-
Method Detail
-
getConnection
public NotifyingSailConnection getConnection() throws SailException
Description copied from interface:SailOpens 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:
getConnectionin interfaceNotifyingSail- Specified by:
getConnectionin interfaceSail- Overrides:
getConnectionin classAbstractSail- 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:AbstractSailReturns a store-specific SailConnection object.- Specified by:
getConnectionInternalin classAbstractSail- Returns:
- A connection to the store.
- Throws:
SailException
-
addSailChangedListener
public void addSailChangedListener(SailChangedListener listener)
Description copied from interface:NotifyingSailAdds the specified SailChangedListener to receive events when the data in this Sail object changes.- Specified by:
addSailChangedListenerin interfaceNotifyingSail
-
removeSailChangedListener
public void removeSailChangedListener(SailChangedListener listener)
Description copied from interface:NotifyingSailRemoves the specified SailChangedListener so that it no longer receives events from this Sail object.- Specified by:
removeSailChangedListenerin interfaceNotifyingSail
-
notifySailChanged
public void notifySailChanged(SailChangedEvent event)
Notifies all registered SailChangedListener's of changes to the contents of this Sail.
-
-