|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.runtime.objectstore.inmemory.InMemoryObjectStore
public class InMemoryObjectStore
| Field Summary | |
|---|---|
protected ObjectStorePersistedObjects |
persistedObjects
|
| Constructor Summary | |
|---|---|
InMemoryObjectStore()
|
|
| Method Summary | |
|---|---|
void |
abortTransaction()
Used by the ObjectStoreTransactionManager to tell the underlying
ObjectStore to abort a transaction. |
void |
attachPersistedObjects(ObjectStorePersistedObjects persistedObjects)
|
void |
close()
|
CreateObjectCommand |
createCreateObjectCommand(NakedObject object)
Makes a naked object persistent. |
DestroyObjectCommand |
createDestroyObjectCommand(NakedObject object)
Removes the specified object from the object store. |
SaveObjectCommand |
createSaveObjectCommand(NakedObject object)
Persists the specified object's state. |
void |
debugData(DebugString debug)
|
java.lang.String |
debugTitle()
|
void |
endTransaction()
Used by the ObjectStoreTransactionManager to tell the underlying
ObjectStore to commit a transaction. |
void |
execute(java.util.List<PersistenceCommand> commands)
Used by the current ObjectStoreTransaction to flush changes to
the ObjectStore (either via a NakedObjectTransactionManager.flushTransaction()
or a NakedObjectTransactionManager.endTransaction()). |
protected InMemoryPersistenceSessionFactory |
getInMemoryPersistenceSessionFactory()
Downcasts the PersistenceSessionFactory to InMemoryPersistenceSessionFactory. |
NakedObject[] |
getInstances(PersistenceQuery persistenceQuery)
|
NakedObject |
getObject(Oid oid,
NakedObjectSpecification hint)
Retrieves the object identified by the specified OID from the object store. |
Oid |
getOidForService(java.lang.String name)
Returns the OID for the adapted service. |
boolean |
hasInstances(NakedObjectSpecification spec)
|
boolean |
isFixturesInstalled()
No permanent persistence, so must always install fixtures. |
java.lang.String |
name()
|
void |
open()
|
void |
registerService(java.lang.String name,
Oid oid)
|
void |
reset()
TODO: move to PersistenceSessionFactory ?? |
void |
resolveField(NakedObject object,
NakedObjectAssociation field)
Called by the resolveEagerly method in NakedObjectManager. |
void |
resolveImmediately(NakedObject adapter)
Called by the resolveImmediately method in NakedObjectManager. |
void |
startTransaction()
Used by the ObjectStoreTransactionManager to tell the underlying
ObjectStore to start a transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ObjectStorePersistedObjects persistedObjects
| Constructor Detail |
|---|
public InMemoryObjectStore()
| Method Detail |
|---|
public java.lang.String name()
name in interface NamedComponentpublic void open()
open in interface SessionScopedComponentpublic void close()
close in interface SessionScopedComponentpublic boolean isFixturesInstalled()
isFixturesInstalled in interface ObjectStorePersistencepublic void reset()
ObjectStorePersistencePersistenceSessionFactory ??
reset in interface ObjectStorePersistencepublic void attachPersistedObjects(ObjectStorePersistedObjects persistedObjects)
public void startTransaction()
ObjectStoreTransactionManagementObjectStoreTransactionManager to tell the underlying
ObjectStore to start a transaction.
startTransaction in interface ObjectStoreTransactionManagementpublic void endTransaction()
ObjectStoreTransactionManagementObjectStoreTransactionManager to tell the underlying
ObjectStore to commit a transaction.
endTransaction in interface ObjectStoreTransactionManagementpublic void abortTransaction()
ObjectStoreTransactionManagementObjectStoreTransactionManager to tell the underlying
ObjectStore to abort a transaction.
abortTransaction in interface ObjectStoreTransactionManagementpublic CreateObjectCommand createCreateObjectCommand(NakedObject object)
ObjectStorePersistencesetOid method). The object, should also be added to the cache as the object is
implicitly 'in use'.
If the object has any associations then each of these, where they aren't already persistent, should also be made persistent by recursively calling this method.
If the object to be persisted is a collection, then each element of that collection, that is not already persistent, should be made persistent by recursively calling this method.
createCreateObjectCommand in interface ObjectStorePersistencepublic SaveObjectCommand createSaveObjectCommand(NakedObject object)
ObjectStorePersistence
createSaveObjectCommand in interface ObjectStorePersistencepublic DestroyObjectCommand createDestroyObjectCommand(NakedObject object)
ObjectStorePersistence
createDestroyObjectCommand in interface ObjectStorePersistence
public void execute(java.util.List<PersistenceCommand> commands)
throws ObjectPersistenceException
ObjectStoreTransactionManagementObjectStoreTransaction to flush changes to
the ObjectStore (either via a NakedObjectTransactionManager.flushTransaction()
or a NakedObjectTransactionManager.endTransaction()).
execute in interface ObjectStorePersistenceexecute in interface ObjectStoreTransactionManagementObjectPersistenceException
public NakedObject getObject(Oid oid,
NakedObjectSpecification hint)
throws ObjectNotFoundException,
ObjectPersistenceException
ObjectStorePersistence
Assuming that the object is not cached then the data for the object should be retreived from the
persistence mechanism and the object recreated (as describe previously). The specified OID should then
be assigned to the recreated object by calling its
If the persistence mechanism does not known of an object with the specified Oid then a
ObjectNotFoundException should be thrown.
Returns the stored NakedObject object .
getObject in interface ObjectStorePersistenceNakedObject that has the specified Oid.
ObjectNotFoundException - when no object corresponding to the oid can be found
ObjectPersistenceException
public void resolveImmediately(NakedObject adapter)
throws ObjectPersistenceException
ObjectStorePersistence
resolveImmediately in interface ObjectStorePersistenceObjectPersistenceExceptionPersistenceSessionContainer.resolveImmediately(NakedObject)
public void resolveField(NakedObject object,
NakedObjectAssociation field)
throws ObjectPersistenceException
ObjectStorePersistence
resolveField in interface ObjectStorePersistenceObjectPersistenceExceptionPersistenceSessionContainer.resolveField(NakedObject, NakedObjectAssociation)
public NakedObject[] getInstances(PersistenceQuery persistenceQuery)
throws ObjectPersistenceException,
UnsupportedFindException
getInstances in interface ObjectStorePersistenceObjectPersistenceException
UnsupportedFindExceptionpublic boolean hasInstances(NakedObjectSpecification spec)
hasInstances in interface ObjectStorePersistencepublic Oid getOidForService(java.lang.String name)
ObjectStorePersistence
getOidForService in interface ObjectStorePersistence
public void registerService(java.lang.String name,
Oid oid)
registerService in interface ObjectStorePersistencepublic java.lang.String debugTitle()
debugTitle in interface DebugInfopublic void debugData(DebugString debug)
debugData in interface DebugInfoprotected InMemoryPersistenceSessionFactory getInMemoryPersistenceSessionFactory()
PersistenceSessionFactory to InMemoryPersistenceSessionFactory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||