public class PersistenceEnvironmentParamBuilder extends Object implements ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment>
PersistenceEnvironment
.
Provide a means to get a PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo
without
creating a PersistenceEnvironment
to be used by a viewer.
Defaulting built into the builder so same defaults whether read in from xml configuration or constructed solely by builder api.
Modifier and Type | Class and Description |
---|---|
static class |
PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo
A
PersistenceEnvironmentInfo
implementation that exposes the active, snapshot and trash directories,
in addition to the persistence mode. |
ParameterizedBuilder.ReflectionSupport
Modifier and Type | Field and Description |
---|---|
protected static SafePersistenceWrappers.FailureContinuationFactory |
DEFAULT_FACTORY
Default failure continuation factory that provides continuations that
only throw PersistenceExceptions.
|
protected ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer>> |
m_bldr
A
ParameterizedBuilder that creates a PersistenceEnvironment . |
protected String |
m_sActive
The active directory used by persistence.
|
protected String |
m_sMode
The mode used by persistence; either active or on-demand.
|
protected String |
m_sSnapshot
The snapshot directory used by persistence.
|
protected String |
m_sTrash
The trash directory used by persistence.
|
Constructor and Description |
---|
PersistenceEnvironmentParamBuilder()
Construct a
PersistenceEnvironment builder. |
Modifier and Type | Method and Description |
---|---|
protected ResolvableParameterList |
createResolver(String sClusterName,
String sServiceName)
Create a
resolver based on the provided
cluster, service name and the state of this builder (active, snapshot
and trash directories). |
static String |
getDefaultPersistenceEnvironmentHomeDirectory()
Return the default 'base' persistence directory.
|
PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo |
getPersistenceEnvironmentInfo(String sClusterName,
String sServiceName)
Return a
PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo encapsulating the configuration
this builder uses to construct environments . |
String |
getPersistenceMode() |
protected boolean |
isActive()
Return true if the persistence mode is active.
|
com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> |
realize(com.tangosol.config.expression.ParameterResolver resolver,
ClassLoader loader,
ParameterList listParameters)
Realizes (creates if necessary) an instance of a object of type T, using the provided
ParameterResolver
to resolve values any referenced Parameter s. |
void |
setActiveDirectory(String sPathname)
Set the persistence active directory.
|
void |
setCustomEnvironment(ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer>> bldrPersistence)
Set a
builder to be used instantiate the
appropriate PersistenceEnvironment . |
void |
setPersistenceMode(String sMode)
Set persistence mode.
|
void |
setPersistenceSnapshotDirectory(String sPathname)
Set the persistence snapshot directory.
|
void |
setPersistenceTrashDirectory(String sPathname)
Set the persistence trash directory.
|
String |
toString() |
protected com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> |
wrap(com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> env)
Wrap a
PersistenceEnvironment with a SafePersistenceEnvironment. |
protected static final SafePersistenceWrappers.FailureContinuationFactory DEFAULT_FACTORY
protected String m_sMode
protected String m_sActive
protected String m_sSnapshot
protected String m_sTrash
protected ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer>> m_bldr
ParameterizedBuilder
that creates a PersistenceEnvironment
.public PersistenceEnvironmentParamBuilder()
PersistenceEnvironment
builder.public com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> realize(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)
ParameterizedBuilder
ParameterResolver
to resolve values any referenced Parameter
s.realize
in interface ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment>
resolver
- the ParameterResolver
for resolving named Parameter
sloader
- the ClassLoader
for loading any necessary classes and if null
the
ClassLoader
used to load the builder will be used insteadlistParameters
- an optional ParameterList
(may be null
) to be used for realizing the
instance, eg: used as constructor parameterspublic PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo getPersistenceEnvironmentInfo(String sClusterName, String sServiceName)
PersistenceEnvironmentParamBuilder.PersistenceEnvironmentInfo
encapsulating the configuration
this builder uses to construct environments
.sClusterName
- the cluster namesServiceName
- the service namepublic String getPersistenceMode()
@Injectable(value="persistence-mode") public void setPersistenceMode(String sMode)
sMode
- active, active-async or on-demand@Injectable(value="active-directory") public void setActiveDirectory(String sPathname)
sPathname
- either relative or absolute pathname@Injectable(value="snapshot-directory") public void setPersistenceSnapshotDirectory(String sPathname)
sPathname
- either relative or absolute pathname@Injectable(value="trash-directory") public void setPersistenceTrashDirectory(String sPathname)
sPathname
- either relative or absolute pathname@Injectable(value="instance") public void setCustomEnvironment(ParameterizedBuilder<com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer>> bldrPersistence)
builder
to be used instantiate the
appropriate PersistenceEnvironment
.bldrPersistence
- the builder that creates a PersistenceEnvironmentprotected com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> wrap(com.oracle.coherence.persistence.PersistenceEnvironment<ReadBuffer> env)
PersistenceEnvironment
with a SafePersistenceEnvironment.env
- a wrapped PersistenceEnvironmentprotected ResolvableParameterList createResolver(String sClusterName, String sServiceName)
resolver
based on the provided
cluster, service name and the state of this builder (active, snapshot
and trash directories).sClusterName
- the name of the clustersServiceName
- the name of the serviceprotected boolean isActive()
public static String getDefaultPersistenceEnvironmentHomeDirectory()
This location is the base for active, snapshot and trash locations if they have not been specified in the operational configuration.
The default base location is $HOME/coherence
.
This location can be overridden by specifying the JVM argument:
-D.