Class SafePersistenceWrappers.SafePersistenceManager<R,T extends Throwable> 
- Type Parameters:
- R- the type of a raw, environment specific object representation
- T- the type of a Throwable failure to protect
- All Implemented Interfaces:
- com.oracle.coherence.persistence.PersistenceManager<R>,- com.oracle.coherence.persistence.PersistenceTools
- Enclosing class:
- SafePersistenceWrappers
Continuation.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Continuation<? super T> The failure continuation for this manager.protected final SafePersistenceWrappers.FailureContinuationFactory<R, ? super T> The FailureContinuationFactory.protected final com.oracle.coherence.persistence.PersistenceManager<R> The underlying PersistenceManager.Fields inherited from class com.tangosol.util.NullImplementation.NullPersistenceManagerINSTANCE
- 
Constructor SummaryConstructorsConstructorDescriptionSafePersistenceManager(com.oracle.coherence.persistence.PersistenceManager<R> mgr) Construct a SafePersistenceManager backed by the specified manager.SafePersistenceManager(com.oracle.coherence.persistence.PersistenceManager<R> mgr, Continuation<? super Throwable> cont) Construct a SafePersistenceManager backed by the specified manager.SafePersistenceManager(com.oracle.coherence.persistence.PersistenceManager<R> mgr, SafePersistenceWrappers.FailureContinuationFactory<R, ? super T> factory) Construct a PersistenceManager backed by the specified manager.
- 
Method SummaryModifier and TypeMethodDescriptionvoidClose the associated PersistentStore and release exclusive access to the associated resources.com.oracle.coherence.persistence.PersistentStore<R> createStore(String sId) Create aPersistentStoreassociated with the specified identifier.booleanRemove the PersistentStore associated with the specified identifier.com.oracle.coherence.persistence.PersistenceManagerReturn the underlying PersistenceManager.getName()Return the name of this manager.booleanReturn true if the specified directory is empty.String[]listOpen()Return the identifiers of PersistentStores that are currently open.com.oracle.coherence.persistence.PersistentStoreInfo[]Return a list of the PersistentStoreInfo known to this manager.voidPerform any necessary maintenance of the underlying environment.voidonException(T t) Called to handle an unexpected exception.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.toString()protected com.oracle.coherence.persistence.PersistentStore<R> Wrap the specified store in a SafePersistentStore implementation.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.voidCopy the PersistentStore associated with the specified identifier to the configured safe area.Methods inherited from class com.tangosol.util.NullImplementation.NullPersistenceManagergetPersistenceInfo, getPersistenceTools, getStatistics, validateMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.coherence.persistence.PersistenceManagercontains
- 
Field Details- 
f_managerThe underlying PersistenceManager.
- 
f_contFailureThe failure continuation for this manager.
- 
f_factoryContprotected final SafePersistenceWrappers.FailureContinuationFactory<R,? super T extends Throwable> f_factoryContThe FailureContinuationFactory.
 
- 
- 
Constructor Details- 
SafePersistenceManagerConstruct a SafePersistenceManager backed by the specified manager.- Parameters:
- mgr- the underlying PersistenceManager
 
- 
SafePersistenceManagerpublic SafePersistenceManager(com.oracle.coherence.persistence.PersistenceManager<R> mgr, Continuation<? super Throwable> cont) Construct a SafePersistenceManager backed by the specified manager.- Parameters:
- mgr- the underlying PersistenceManager
- cont- the failure continuation to use to handle unexpected exceptions
 
- 
SafePersistenceManagerpublic SafePersistenceManager(com.oracle.coherence.persistence.PersistenceManager<R> mgr, SafePersistenceWrappers.FailureContinuationFactory<R, ? super T> factory) Construct a PersistenceManager backed by the specified manager.- Parameters:
- mgr- the underlying PersistenceManager
- factory- the failure continuation factory to use to create handlers for unexpected exceptions
 
 
- 
- 
Method Details- 
getManagerpublic com.oracle.coherence.persistence.PersistenceManager getManager()Return the underlying PersistenceManager.- Returns:
- the underlying PersistenceManager
 
- 
onExceptionCalled to handle an unexpected exception.- Parameters:
- t- the Throwable
 
- 
wrapprotected com.oracle.coherence.persistence.PersistentStore<R> wrap(com.oracle.coherence.persistence.PersistentStore<R> store) Wrap the specified store in a SafePersistentStore implementation.- Parameters:
- store- the underlying PersistentStore
- Returns:
- a "safe" PersistenceManger or null if the specified store is null
 
- 
getNameDescription copied from class:NullImplementation.NullPersistenceManagerReturn the name of this manager.- Specified by:
- getNamein interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- getNamein class- NullImplementation.NullPersistenceManager<R>
- Returns:
- the name of this manager
 
- 
createStoreDescription 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 interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- createStorein class- NullImplementation.NullPersistenceManager<R>
- Parameters:
- sId- a unique identifier of the store
- Returns:
- a persistent store
 
- 
openpublic com.oracle.coherence.persistence.PersistentStore<R> open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store) Description copied from class:NullImplementation.NullPersistenceManagerOpen 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 interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- openin class- NullImplementation.NullPersistenceManager<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
 
- 
openpublic com.oracle.coherence.persistence.PersistentStore<R> open(String sId, com.oracle.coherence.persistence.PersistentStore<R> store, Collector<Object> collector) Description copied from class:NullImplementation.NullPersistenceManagerOpen 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 interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- openin class- NullImplementation.NullPersistenceManager<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
 
- 
closeDescription copied from class:NullImplementation.NullPersistenceManagerClose the associated PersistentStore and release exclusive access to the associated resources.- Specified by:
- closein interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- closein class- NullImplementation.NullPersistenceManager<R>
- Parameters:
- sId- a unique identifier of the store to close
 
- 
deleteDescription copied from class:NullImplementation.NullPersistenceManagerRemove the PersistentStore associated with the specified identifier.- Specified by:
- deletein interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- deletein class- NullImplementation.NullPersistenceManager<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
 
- 
listStoreInfopublic com.oracle.coherence.persistence.PersistentStoreInfo[] listStoreInfo()Description copied from interface:com.oracle.coherence.persistence.PersistenceManagerReturn a list of the PersistentStoreInfo known to this manager.- Specified by:
- listStoreInfoin interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- listStoreInfoin class- NullImplementation.NullPersistenceManager<R>
- Returns:
- a list of the known PersistentStoreInfo
 
- 
listOpenDescription copied from class:NullImplementation.NullPersistenceManagerReturn the identifiers of PersistentStores that are currently open.- Specified by:
- listOpenin interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- listOpenin class- NullImplementation.NullPersistenceManager<R>
- Returns:
- a list of the open store identifiers
 
- 
isEmptyDescription copied from interface:com.oracle.coherence.persistence.PersistenceManagerReturn true if the specified directory is empty.- Specified by:
- isEmptyin interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- isEmptyin class- NullImplementation.NullPersistenceManager<R>
- Returns:
- true if the specified directory is empty
 
- 
readDescription copied from class:NullImplementation.NullPersistenceManagerRead the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.- Specified by:
- readin interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- readin class- NullImplementation.NullPersistenceManager<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
 
- 
writeDescription copied from class:NullImplementation.NullPersistenceManagerWrite the PersistentStore associated with the specified identifier to the given output stream.- Specified by:
- writein interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- writein class- NullImplementation.NullPersistenceManager<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
 
- 
writeSafeDescription copied from interface:com.oracle.coherence.persistence.PersistenceManagerCopy the PersistentStore associated with the specified identifier to the configured safe area.
- 
readDescription copied from class:NullImplementation.NullPersistenceManagerRead the PersistenceStore associated with the specified identifier from the given input stream, making it available to this manager.- Specified by:
- readin interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- readin class- NullImplementation.NullPersistenceManager<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
 
- 
writeDescription copied from class:NullImplementation.NullPersistenceManagerWrite the PersistentStore associated with the specified identifier to the given output buffer.- Specified by:
- writein interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- writein class- NullImplementation.NullPersistenceManager<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
 
- 
releasepublic void release()Description copied from class:NullImplementation.NullPersistenceManagerRelease 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 interface- com.oracle.coherence.persistence.PersistenceManager<R>
- Overrides:
- releasein class- NullImplementation.NullPersistenceManager<R>
 
- 
maintainEnvironmentpublic void maintainEnvironment()Description copied from interface:com.oracle.coherence.persistence.PersistenceManagerPerform any necessary maintenance of the underlying environment.
- 
toString
 
-