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
FieldsModifier and TypeFieldDescriptionstatic final NullImplementation.NullPersistenceManagerSingleton instance of a NullPersistenceManager. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the associated PersistentStore and release exclusive access to the associated resources.com.oracle.coherence.persistence.PersistentStorecreateStore(String sId) Create aPersistentStoreassociated with the specified identifier.booleanRemove the PersistentStore associated with the specified identifier.getName()Return the name of this manager.com.oracle.coherence.persistence.OfflinePersistenceInfoReturn summary information regarding the availablePersistentStores under the context of thePersistenceManager(snapshot or archived snapshot).com.oracle.coherence.persistence.PersistenceToolsReturn an instance ofPersistenceToolsallowing offline operations to be performed against the associated PersistenceManager and appropriatePersistentStore.com.oracle.coherence.persistence.PersistenceStatisticsReturn aPersistenceStatisticsobject representing the availablePersistentStores 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 aPersistentStoreassociated 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 aPersistentStoreassociated with the specified identifier and based on the providedstore.voidread(String sId, ReadBuffer.BufferInput in) Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.voidread(String sId, InputStream in) Read the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.voidrelease()Release all resources held by this manager.voidvalidate()Validate the availablePersistentStores under the context of the associatedPersistenceManager(snapshot or archived snapshot).voidwrite(String sId, WriteBuffer.BufferOutput out) Write the PersistentStore associated with the specified identifier to the given output buffer.voidwrite(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, waitMethods inherited from interface com.oracle.coherence.persistence.PersistenceManager
contains, maintainEnvironment, 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:
getNamein interfacecom.oracle.coherence.persistence.PersistenceManager<R>- Returns:
- the name of this manager
-
createStore
Description copied from interface:com.oracle.coherence.persistence.PersistenceManagerCreate aPersistentStoreassociated 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
opensthe same identifier.- Specified by:
createStorein 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 aPersistentStoreassociated 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:
openin 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 aPersistentStoreassociated 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
Collectorallows 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:
openin 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:
closein 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:
deletein 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:
listin 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:
listOpenin 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:
readin 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:
writein 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:
readin 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:
writein 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:
releasein interfacecom.oracle.coherence.persistence.PersistenceManager<R>
-
getPersistenceTools
public com.oracle.coherence.persistence.PersistenceTools getPersistenceTools()Return an instance ofPersistenceToolsallowing offline operations to be performed against the associated PersistenceManager and appropriatePersistentStore.- Specified by:
getPersistenceToolsin 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.PersistenceToolsReturn summary information regarding the availablePersistentStores under the context of thePersistenceManager(snapshot or archived snapshot).- Specified by:
getPersistenceInfoin interfacecom.oracle.coherence.persistence.PersistenceTools- Returns:
- summary information about the specific snapshot
-
validate
public void validate()Description copied from interface:com.oracle.coherence.persistence.PersistenceToolsValidate the availablePersistentStores under the context of the associatedPersistenceManager(snapshot or archived snapshot).- Specified by:
validatein interfacecom.oracle.coherence.persistence.PersistenceTools
-
getStatistics
public com.oracle.coherence.persistence.PersistenceStatistics getStatistics()Description copied from interface:com.oracle.coherence.persistence.PersistenceToolsReturn aPersistenceStatisticsobject representing the availablePersistentStores under the context of the associatedPersistenceManager(snapshot or archived snapshot).- Specified by:
getStatisticsin interfacecom.oracle.coherence.persistence.PersistenceTools- Returns:
- a PersistenceStatistics object representing a snapshot
-