Class NullImplementation.NullPersistenceManager<R>

java.lang.Object
com.tangosol.util.NullImplementation.NullPersistenceManager<R>
Type Parameters:
R - the raw value type
All Implemented Interfaces:
com.oracle.coherence.persistence.PersistenceManager<R>, com.oracle.coherence.persistence.PersistenceTools
Direct Known Subclasses:
SafePersistenceWrappers.SafePersistenceManager
Enclosing class:
NullImplementation

public static class NullImplementation.NullPersistenceManager<R> extends Object implements com.oracle.coherence.persistence.PersistenceManager<R>, com.oracle.coherence.persistence.PersistenceTools
A PersistenceManager that does nothing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Singleton instance of a NullPersistenceManager.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the associated PersistentStore and release exclusive access to the associated resources.
    com.oracle.coherence.persistence.PersistentStore
    Create a PersistentStore associated with the specified identifier.
    boolean
    delete(String sId, boolean fSafe)
    Remove the PersistentStore associated with the specified identifier.
    Return the name of this manager.
    com.oracle.coherence.persistence.OfflinePersistenceInfo
    Return summary information regarding the available PersistentStores under the context of the PersistenceManager (snapshot or archived snapshot).
    com.oracle.coherence.persistence.PersistenceTools
    Return an instance of PersistenceTools allowing offline operations to be performed against the associated PersistenceManager and appropriate PersistentStore.
    com.oracle.coherence.persistence.PersistenceStatistics
    Return a PersistenceStatistics object representing the available PersistentStores under the context of the associated PersistenceManager (snapshot or archived snapshot).
    Return the identifiers of the PersistentStores known to this manager.
    Return the identifiers of PersistentStores that are currently open.
    com.oracle.coherence.persistence.PersistentStore<R>
    open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store)
    Open or create a PersistentStore associated with the specified identifier and based on the provided store.
    com.oracle.coherence.persistence.PersistentStore<R>
    open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store, Collector<Object> collector)
    Open or create a PersistentStore associated with the specified identifier and based on the provided store.
    void
    Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.
    void
    Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.
    void
    Release all resources held by this manager.
    void
    Validate the available PersistentStores under the context of the associated PersistenceManager (snapshot or archived snapshot).
    void
    Write the PersistentStore associated with the specified identifier to the given output buffer.
    void
    Write the PersistentStore associated with the specified identifier to the given output stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.oracle.coherence.persistence.PersistenceManager

    contains, writeSafe
  • Field Details

  • Constructor Details

    • NullPersistenceManager

      public NullPersistenceManager()
  • Method Details

    • getName

      public String getName()
      Return the name of this manager.
      Specified by:
      getName in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Returns:
      the name of this manager
    • createStore

      public com.oracle.coherence.persistence.PersistentStore createStore(String sId)
      Description copied from interface: com.oracle.coherence.persistence.PersistenceManager
      Create a PersistentStore associated with the specified identifier.

      Creation of a store suggests its registration but has no usage until it transitions into a state of open. The implementation may choose to forgo any resource allocation until the caller opens the same identifier.

      Specified by:
      createStore in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store
      Returns:
      a persistent store
    • open

      public com.oracle.coherence.persistence.PersistentStore<R> open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store)
      Open or create a PersistentStore associated with the specified identifier and based on the provided store.

      Upon a new store being created the provided store should be used as the basis for the new store such that the extents and associated data is available in the returned store. This provides an opportunity for an implementation to optimize initializing the new store based upon knowledge of the storage mechanics.

      Specified by:
      open in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier for the store
      store - the PersistenceStore the new store should be based upon
      Returns:
      a PersistentStore associated with the specified identifier
    • open

      public com.oracle.coherence.persistence.PersistentStore<R> open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store, Collector<Object> collector)
      Open or create a PersistentStore associated with the specified identifier and based on the provided store.

      Upon a new store being created the provided store should be used as the basis for the new store such that the extents and associated data is available in the returned store. This provides an opportunity for an implementation to optimize initializing the new store based upon knowledge of the storage mechanics.

      Providing a Collector allows the open operation to be performed asynchronously. This may be desirable when the calling thread can not be blocked on IO operations that are required when creating a new store based on an old store (storeFrom). Open is only non-blocking when both an old store and a Collector are provided. Upon completion of an asynchronous open request the provided Collector is called with either a String (GUID) or an AsyncPersistenceException, thus notifying the collector of success of failure respectively.

      Note: the behavior of a returned store that has not been opened is undefined.

      Specified by:
      open in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier for the store
      store - the PersistenceStore the new store should be based upon
      collector - the Collector to notify once the store has been opened or failed to open; the collector will either receive a String (GUID) or an AsyncPersistenceException
      Returns:
      a PersistentStore associated with the specified identifier
    • close

      public void close(String sId)
      Close the associated PersistentStore and release exclusive access to the associated resources.
      Specified by:
      close in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to close
    • delete

      public boolean delete(String sId, boolean fSafe)
      Remove the PersistentStore associated with the specified identifier.
      Specified by:
      delete in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to remove
      fSafe - if true, remove the store by moving it to a restorable location (if possible) rather than deleting it
      Returns:
      true if the store was successfully removed, false otherwise
    • list

      public String[] list()
      Return the identifiers of the PersistentStores known to this manager.
      Specified by:
      list in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Returns:
      a list of the known store identifiers
    • listOpen

      public String[] listOpen()
      Return the identifiers of PersistentStores that are currently open.
      Specified by:
      listOpen in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Returns:
      a list of the open store identifiers
    • read

      public void read(String sId, InputStream in) throws IOException
      Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.
      Specified by:
      read in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to read
      in - the stream to read from
      Throws:
      IOException - if an error occurred while reading from the stream
    • write

      public void write(String sId, OutputStream out) throws IOException
      Write the PersistentStore associated with the specified identifier to the given output stream.
      Specified by:
      write in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to write
      out - the stream to write to
      Throws:
      IOException - if an error occurred while writing to the stream
    • read

      public void read(String sId, ReadBuffer.BufferInput in) throws IOException
      Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.
      Specified by:
      read in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to read
      in - the stream to read from
      Throws:
      IOException - if an error occurred while reading from the stream
    • write

      public void write(String sId, WriteBuffer.BufferOutput out) throws IOException
      Write the PersistentStore associated with the specified identifier to the given output buffer.
      Specified by:
      write in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Parameters:
      sId - a unique identifier of the store to write
      out - the output buffer to write to
      Throws:
      IOException - if an error occurred while writing to the stream
    • release

      public void release()
      Release all resources held by this manager. Note that the behavior of all other methods on this manager is undefined after this method is called.
      Specified by:
      release in interface com.oracle.coherence.persistence.PersistenceManager<R>
    • getPersistenceTools

      public com.oracle.coherence.persistence.PersistenceTools getPersistenceTools()
      Return an instance of PersistenceTools allowing offline operations to be performed against the associated PersistenceManager and appropriate PersistentStore.
      Specified by:
      getPersistenceTools in interface com.oracle.coherence.persistence.PersistenceManager<R>
      Returns:
      a PersistenceTools implementation
    • getPersistenceInfo

      public com.oracle.coherence.persistence.OfflinePersistenceInfo getPersistenceInfo()
      Description copied from interface: com.oracle.coherence.persistence.PersistenceTools
      Return summary information regarding the available PersistentStores under the context of the PersistenceManager (snapshot or archived snapshot).
      Specified by:
      getPersistenceInfo in interface com.oracle.coherence.persistence.PersistenceTools
      Returns:
      summary information about the specific snapshot
    • validate

      public void validate()
      Description copied from interface: com.oracle.coherence.persistence.PersistenceTools
      Validate the available PersistentStores under the context of the associated PersistenceManager (snapshot or archived snapshot).
      Specified by:
      validate in interface com.oracle.coherence.persistence.PersistenceTools
    • getStatistics

      public com.oracle.coherence.persistence.PersistenceStatistics getStatistics()
      Description copied from interface: com.oracle.coherence.persistence.PersistenceTools
      Return a PersistenceStatistics object representing the available PersistentStores under the context of the associated PersistenceManager (snapshot or archived snapshot).
      Specified by:
      getStatistics in interface com.oracle.coherence.persistence.PersistenceTools
      Returns:
      a PersistenceStatistics object representing a snapshot