R
- the type of a raw, environment specific object representationT
- the type of a Throwable failure to protectpublic static class SafePersistenceWrappers.SafePersistenceManager<R,T extends Throwable> extends NullImplementation.NullPersistenceManager<R>
Continuation
.Modifier and Type | Field and Description |
---|---|
protected Continuation<? super T> |
f_contFailure
The failure continuation for this manager.
|
protected SafePersistenceWrappers.FailureContinuationFactory<R,? super T> |
f_factoryCont
The FailureContinuationFactory.
|
protected com.oracle.datagrid.persistence.PersistenceManager<R> |
f_manager
The underlying PersistenceManager.
|
INSTANCE
Constructor and Description |
---|
SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr)
Construct a SafePersistenceManager backed by the specified manager.
|
SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr, Continuation<? super Throwable> cont)
Construct a SafePersistenceManager backed by the specified manager.
|
SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr, SafePersistenceWrappers.FailureContinuationFactory<R,? super T> factory)
Construct a PersistenceManager backed by the specified manager.
|
Modifier and Type | Method and Description |
---|---|
void |
close(String sId)
Close the associated PersistentStore and release exclusive access to the associated resources.
|
boolean |
delete(String sId, boolean fSafe)
Remove the PersistentStore associated with the specified identifier.
|
com.oracle.datagrid.persistence.PersistenceManager |
getManager()
Return the underlying PersistenceManager.
|
String |
getName()
Return the name of this manager.
|
String[] |
list()
Return the identifiers of the PersistentStores known to this manager.
|
String[] |
listOpen()
Return the identifiers of PersistentStores that are currently open.
|
void |
onException(T t)
Called to handle an unexpected exception.
|
com.oracle.datagrid.persistence.PersistentStore<R> |
open(String sId, com.oracle.datagrid.persistence.PersistentStore<R> store)
Open or create a
PersistentStore associated with the specified identifier and based on the provided store . |
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.
|
String |
toString()
Return a human readable description of this SafePersistenceManager.
|
protected com.oracle.datagrid.persistence.PersistentStore<R> |
wrap(com.oracle.datagrid.persistence.PersistentStore<R> store)
Wrap the specified store in a SafePersistentStore implementation.
|
void |
write(String sId, OutputStream out)
Write the PersistentStore associated with the specified identifier to the given output stream.
|
getPersistenceInfo, getPersistenceTools, getStatistics, validate
protected final com.oracle.datagrid.persistence.PersistenceManager<R> f_manager
protected final Continuation<? super T extends Throwable> f_contFailure
protected final SafePersistenceWrappers.FailureContinuationFactory<R,? super T extends Throwable> f_factoryCont
public SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr)
mgr
- the underlying PersistenceManagerpublic SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr, Continuation<? super Throwable> cont)
mgr
- the underlying PersistenceManagercont
- the failure continuation to use to handle unexpected exceptionspublic SafePersistenceManager(com.oracle.datagrid.persistence.PersistenceManager<R> mgr, SafePersistenceWrappers.FailureContinuationFactory<R,? super T> factory)
mgr
- the underlying PersistenceManagerfactory
- the failure continuation factory to use to create handlers for unexpected exceptionspublic com.oracle.datagrid.persistence.PersistenceManager getManager()
public void onException(T t)
t
- the Throwableprotected com.oracle.datagrid.persistence.PersistentStore<R> wrap(com.oracle.datagrid.persistence.PersistentStore<R> store)
store
- the underlying PersistentStorepublic String getName()
getName
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
getName
in class NullImplementation.NullPersistenceManager<R>
public com.oracle.datagrid.persistence.PersistentStore<R> open(String sId, com.oracle.datagrid.persistence.PersistentStore<R> store)
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.
open
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
open
in class NullImplementation.NullPersistenceManager<R>
sId
- a unique identifier for the storestore
- the PersistenceStore the new store should be based uponpublic void close(String sId)
close
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
close
in class NullImplementation.NullPersistenceManager<R>
sId
- a unique identifier of the store to closepublic boolean delete(String sId, boolean fSafe)
delete
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
delete
in class NullImplementation.NullPersistenceManager<R>
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 itpublic String[] list()
list
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
list
in class NullImplementation.NullPersistenceManager<R>
public String[] listOpen()
listOpen
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
listOpen
in class NullImplementation.NullPersistenceManager<R>
public void read(String sId, InputStream in) throws IOException
read
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
read
in class NullImplementation.NullPersistenceManager<R>
sId
- a unique identifier of the store to readin
- the stream to read fromIOException
- if an error occurred while reading from the streampublic void write(String sId, OutputStream out) throws IOException
write
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
write
in class NullImplementation.NullPersistenceManager<R>
sId
- a unique identifier of the store to writeout
- the stream to write toIOException
- if an error occurred while writing to the streampublic void release()
release
in interface com.oracle.datagrid.persistence.PersistenceManager<R>
release
in class NullImplementation.NullPersistenceManager<R>