|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vinculumtech.platform.root.PersistenceSession com.vinculumtech.platform.root.persistence.InMemoryPersistenceSession
The InMemoryPersistenceSession is a simple PersistenceSession
implementation that provides in memory
storage of Imageable
instances. It may optionally store all
manages instances to a serialized file (enabled by the inmemory.persist
property, and
specified by the inmemory.filename
property).
It is intended that this PersistenceSession be used for prototyping new applications before selecting, coupling,
and optimizing any commercial or open-source object/relational or object database persistence tool. CarrierWave
ships with a few additional PersistenceSession implementations for JDO, and other persistence tools.
Note that the InMemoryObjectFinder
and InMemoryCollectionFinder
classes can be subclassed for
custom typed finder types. Or more conveniently, the OGNLObjectFinder
and OGNLCollectionFinder
classes can be used with
any PersistenceSession implementation as they use the OGNL library to
navigate and query Imageable
object instances.
*
Field Summary | |
static java.lang.String |
PERSIST
|
static java.lang.String |
PERSIST_FILE
|
Fields inherited from class com.vinculumtech.platform.root.PersistenceSession |
REFERENCEABLE_NAME_FIELD |
Constructor Summary | |
InMemoryPersistenceSession()
|
Method Summary | |
void |
beginSession(boolean readOnly)
Initialize the session for the current Thread . |
void |
commitSession()
Perform any necessary cleanup before the session is completed. |
java.lang.Object |
createInstanceOf(java.lang.Class type)
Create a new persistant instance of the given type. |
void |
deleteInstance(java.lang.Object object)
Delete an object. |
java.util.List |
findAllInstancesOf(java.lang.Class type,
boolean excludeSubclasses)
Return a List of all objects of the given type.If no object is found, an empty List is returned. |
java.lang.Object |
findInstanceOf(java.lang.Class type,
java.lang.Object objectId)
Return the existing object of the specified type with the given id. If no object is found, null is returned. |
java.lang.Object |
findInstanceOf(java.lang.Class type,
java.lang.String referenceableName)
Return the existing object of the specified type with the given referenceableName. Referenceable names are names that are more durable than the persistence tool object id, and are suitable for explicit referencing by remote applications. |
java.lang.Object |
getIdentityOf(java.lang.Object object)
|
static ObjectManager |
getObjectCache()
|
boolean |
isReadOnly()
|
protected void |
lock()
|
protected void |
release()
|
void |
rollbackSession()
Rollback the current session. |
void |
setReadOnly(boolean readOnly)
|
Methods inherited from class com.vinculumtech.platform.root.PersistenceSession |
findAllInstancesOf, findInstanceOf, getReferenceableNameField, getReferenceableNameOf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PERSIST
public static final java.lang.String PERSIST_FILE
Constructor Detail |
public InMemoryPersistenceSession()
Method Detail |
public static ObjectManager getObjectCache()
protected void lock()
protected void release()
public boolean isReadOnly()
public void setReadOnly(boolean readOnly)
public void beginSession(boolean readOnly)
PersistenceSession
Thread
.
beginSession
in class PersistenceSession
readOnly
- Specifies whether this session will make modifications to domain objects or notpublic java.lang.Object createInstanceOf(java.lang.Class type)
PersistenceSession
createInstanceOf
in class PersistenceSession
type
-
public void deleteInstance(java.lang.Object object)
PersistenceSession
deleteInstance
in class PersistenceSession
object
- public java.lang.Object getIdentityOf(java.lang.Object object)
getIdentityOf
in class PersistenceSession
public void commitSession()
PersistenceSession
commitSession
in class PersistenceSession
public void rollbackSession()
PersistenceSession
rollbackSession
in class PersistenceSession
public java.util.List findAllInstancesOf(java.lang.Class type, boolean excludeSubclasses)
PersistenceSession
List
of all objects of the given type.
findAllInstancesOf
in class PersistenceSession
type
-
public java.lang.Object findInstanceOf(java.lang.Class type, java.lang.Object objectId)
PersistenceSession
findInstanceOf
in class PersistenceSession
type
- objectId
-
public java.lang.Object findInstanceOf(java.lang.Class type, java.lang.String referenceableName)
PersistenceSession
PersistenceSession.REFERENCEABLE_NAME_FIELD
when searching
for the applicable object. Or it should use a custom naming scheme.
findInstanceOf
in class PersistenceSession
type
- referenceableName
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |