Class 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
PersistenceManager
that does nothing.-
Field Summary
Modifier and TypeFieldDescriptionstatic final NullImplementation.NullPersistenceManager
Singleton instance of a NullPersistenceManager. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Close the associated PersistentStore and release exclusive access to the associated resources.com.oracle.coherence.persistence.PersistentStore
createStore
(String sId) Create aPersistentStore
associated with the specified identifier.boolean
Remove the PersistentStore associated with the specified identifier.getName()
Return the name of this manager.com.oracle.coherence.persistence.OfflinePersistenceInfo
Return summary information regarding the availablePersistentStore
s under the context of thePersistenceManager
(snapshot or archived snapshot).com.oracle.coherence.persistence.PersistenceTools
Return an instance ofPersistenceTools
allowing offline operations to be performed against the associated PersistenceManager and appropriatePersistentStore
.com.oracle.coherence.persistence.PersistenceStatistics
Return aPersistenceStatistics
object representing the availablePersistentStore
s under the context of the associatedPersistenceManager
(snapshot or archived snapshot).String[]
list()
Return the identifiers of the PersistentStores known to this manager.String[]
listOpen()
Return the identifiers of PersistentStores that are currently open.com.oracle.coherence.persistence.PersistentStore
<R> Open or create aPersistentStore
associated with the specified identifier and based on the providedstore
.com.oracle.coherence.persistence.PersistentStore
<R> open
(String sId, com.oracle.coherence.persistence.PersistentStore<R> store, Collector<Object> collector) Open or create aPersistentStore
associated with the specified identifier and based on the providedstore
.void
read
(String sId, ReadBuffer.BufferInput in) Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.void
read
(String sId, InputStream in) Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.void
release()
Release all resources held by this manager.void
validate()
Validate the availablePersistentStore
s under the context of the associatedPersistenceManager
(snapshot or archived snapshot).void
write
(String sId, WriteBuffer.BufferOutput out) Write the PersistentStore associated with the specified identifier to the given output buffer.void
write
(String sId, OutputStream out) 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
-
INSTANCE
Singleton instance of a NullPersistenceManager.
-
-
Constructor Details
-
NullPersistenceManager
public NullPersistenceManager()
-
-
Method Details
-
getName
Return the name of this manager.- Specified by:
getName
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Returns:
- the name of this manager
-
createStore
Description copied from interface:com.oracle.coherence.persistence.PersistenceManager
Create aPersistentStore
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 interfacecom.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 aPersistentStore
associated with the specified identifier and based on the providedstore
.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 interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier for the storestore
- 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 aPersistentStore
associated with the specified identifier and based on the providedstore
.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 interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier for the storestore
- the PersistenceStore the new store should be based uponcollector
- 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
Close the associated PersistentStore and release exclusive access to the associated resources.- Specified by:
close
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to close
-
delete
Remove the PersistentStore associated with the specified identifier.- Specified by:
delete
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to removefSafe
- 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
Return the identifiers of the PersistentStores known to this manager.- Specified by:
list
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Returns:
- a list of the known store identifiers
-
listOpen
Return the identifiers of PersistentStores that are currently open.- Specified by:
listOpen
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Returns:
- a list of the open store identifiers
-
read
Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.- Specified by:
read
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to readin
- the stream to read from- Throws:
IOException
- if an error occurred while reading from the stream
-
write
Write the PersistentStore associated with the specified identifier to the given output stream.- Specified by:
write
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to writeout
- the stream to write to- Throws:
IOException
- if an error occurred while writing to the stream
-
read
Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.- Specified by:
read
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to readin
- the stream to read from- Throws:
IOException
- if an error occurred while reading from the stream
-
write
Write the PersistentStore associated with the specified identifier to the given output buffer.- Specified by:
write
in interfacecom.oracle.coherence.persistence.PersistenceManager<R>
- Parameters:
sId
- a unique identifier of the store to writeout
- 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 interfacecom.oracle.coherence.persistence.PersistenceManager<R>
-
getPersistenceTools
public com.oracle.coherence.persistence.PersistenceTools getPersistenceTools()Return an instance ofPersistenceTools
allowing offline operations to be performed against the associated PersistenceManager and appropriatePersistentStore
.- Specified by:
getPersistenceTools
in interfacecom.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 availablePersistentStore
s under the context of thePersistenceManager
(snapshot or archived snapshot).- Specified by:
getPersistenceInfo
in interfacecom.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 availablePersistentStore
s under the context of the associatedPersistenceManager
(snapshot or archived snapshot).- Specified by:
validate
in interfacecom.oracle.coherence.persistence.PersistenceTools
-
getStatistics
public com.oracle.coherence.persistence.PersistenceStatistics getStatistics()Description copied from interface:com.oracle.coherence.persistence.PersistenceTools
Return aPersistenceStatistics
object representing the availablePersistentStore
s under the context of the associatedPersistenceManager
(snapshot or archived snapshot).- Specified by:
getStatistics
in interfacecom.oracle.coherence.persistence.PersistenceTools
- Returns:
- a PersistenceStatistics object representing a snapshot
-