|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<PersistenceDefinition> net.sourceforge.domian.repository.PersistenceDefinition
public enum PersistenceDefinition
Definitions regarding the nature of the different persistence mechanisms that Domian repositories may inhibit. Each individual repository implementation supports one or more of these definitions.
Enum Constant Summary | |
---|---|
DELEGATED
This persistence definition dictates that all Repository
operations are delegated to an external persistence mechanism. |
|
FILE
This persistence definition dictates that all Repository
operations are directly forwarded to one or more files. |
|
INMEMORY
This persistence definition should really be denominated NO_PERSISTENCE . |
|
INMEMORY_AND_DELEGATED
This persistence definition dictates an asynchronous persistence scheme. |
|
INMEMORY_AND_FILE
This persistence definition dictates an asynchronous persistence scheme. |
Method Summary | |
---|---|
boolean |
isDelegated()
|
boolean |
isDelegatedOnly()
|
boolean |
isFileBased()
|
boolean |
isFileBasedOnly()
|
boolean |
isMemoryBased()
|
boolean |
isMemoryBasedOnly()
|
boolean |
isNotMemoryBased()
|
boolean |
supportsAsynchronousPersistence()
|
java.lang.String |
toString()
|
static PersistenceDefinition |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static PersistenceDefinition[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final PersistenceDefinition FILE
Repository
operations are directly forwarded to one or more files.
No Domian in-memory functionality are in use.
The load
and persist
methods are deactivated, as put
, update
,
and find
have taken their role in this particular persistence definition.
Resolving possibly duplicate entities must be done manually in client code,
as this definition implies that repositories always returns fresh objects.
Repositories implementing the semantics of this definition, and working in shared mode,
must also do some sort of file locking for safe usage.
NB! File-based stores counts as persistent storage media,
although the nature of the writings to disc obviously depends on the file system implementations involved.
To be considered: The in-memory entities are kept as a read-only cache. (establish another definition for this)
public static final PersistenceDefinition DELEGATED
Repository
operations are delegated to an external persistence mechanism. That mechanism will be provided by some third-party library,
typically reflected in the repository name. The repository method semantics will depend on the delegated persistence
implementation and should be thoroughly described in the repository documentation.
public static final PersistenceDefinition INMEMORY
NO_PERSISTENCE
.
It is included for completeness, and as a basis for the asynchronous persistence definitions INMEMORY_AND_*
,
described below..
public static final PersistenceDefinition INMEMORY_AND_FILE
load()
means purging all your in-memory entities and replacing them with the persisted entities.
persist()
means purging all your persisted entities and replacing them with the in-memory entities.
Repositories implementing this definition semantics should always be working in embedded mode,
as shared mode could easily overwrite each other's data.
A strict locking mechanism must be applied to prevent such unfortunate scenarios.
NB! File-based stores counts as persistent storage media,
although the nature of the writings to disc obviously depends on the file system implementations involved.
public static final PersistenceDefinition INMEMORY_AND_DELEGATED
load()
means purging all your in-memory entities and replacing them with the persisted entities.
persist()
means purging all your persisted entities and replacing them with the in-memory entities.
Repositories implementing this definition semantics should always be working in embedded mode,
as shared mode could easily overwrite each other's data.
A strict locking mechanism must be applied to prevent such unfortunate scenarios.
Method Detail |
---|
public static PersistenceDefinition[] values()
for (PersistenceDefinition c : PersistenceDefinition.values()) System.out.println(c);
public static PersistenceDefinition valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic boolean isFileBased()
public boolean isFileBasedOnly()
public boolean isMemoryBased()
public boolean isMemoryBasedOnly()
public boolean isDelegated()
public boolean isDelegatedOnly()
public boolean isNotMemoryBased()
public boolean supportsAsynchronousPersistence()
true
if this repository inhibit asynchronous persistence capabilitiespublic java.lang.String toString()
toString
in class java.lang.Enum<PersistenceDefinition>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |