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, MemoryStore, NativeStore, NotifyingSailBase

      public abstract class AbstractNotifyingSail
      extends AbstractSail
      implements NotifyingSail

  A base `NotifyingSail` 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.eclipse.rdf4j.sail.helpers.AbstractSail

      `connectionTimeOut, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_ITERATION_SYNC_THRESHOLD, initializationLock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractNotifyingSail()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.eclipse.rdf4j.sail.helpers.AbstractSail

      `addSupportedIsolationLevel, connectionClosed, debugEnabled, getDataDir, getDefaultIsolationLevel, getIterationCacheSyncThreshold, getSupportedIsolationLevels, init, initialize, 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, initialize, isWritable, setDataDir, shutDown`

- - ### Constructor Detail

    - #### AbstractNotifyingSail

          public AbstractNotifyingSail()

  - ### 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 `AbstractSail`
      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: `AbstractSail`
      Returns a store-specific SailConnection object.
      Specified by:
        `getConnectionInternal` in class `AbstractSail`
      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 © 2015-2022 Eclipse Foundation. All Rights Reserved.