|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.persistence.MemoryStorage
This class is an implementation of Storage which provides in-memory storage. This class is specifically *NOT* designed to provide persistent storage, and simply functions as an enhanced hash table.
Constructor Summary | |
MemoryStorage(IdFactory factory)
Builds a MemoryStorage object. |
Method Summary | |
boolean |
exists(Id id)
Returns whether or not the provided id exists |
void |
exists(Id id,
Continuation c)
Returns whether or not the provided id exists, by returning a Boolean through receiveResult on c |
void |
getObject(Id id,
Continuation c)
Returns the object identified by the given id, or null if
there is no cooresponding object (through receiveResult on c). |
void |
getTotalSize(Continuation c)
Returns the total size of the stored data in bytes.The result is returned via the receiveResult method on the provided Continuation with an Integer representing the size. |
IdSet |
scan(IdRange range)
Return the objects identified by the given range of ids. |
void |
scan(IdRange range,
Continuation c)
Return the objects identified by the given range of ids. |
void |
store(Id id,
java.io.Serializable obj,
Continuation c)
Stores the object under the key id . |
void |
unstore(Id id,
Continuation c)
Removes the object from the list of stored objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MemoryStorage(IdFactory factory)
factory
- The factory to build protocol-specific Ids from.Method Detail |
public void store(Id id, java.io.Serializable obj, Continuation c)
id
. If there is already
an object under id
, that object is replaced.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
store
in interface Storage
obj
- The object to be made persistent.id
- The object's id.c
- The command to run once the operation is complete
true
if the action succeeds, else
false
.public void unstore(Id id, Continuation c)
false
is returned.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
unstore
in interface Storage
id
- The object's persistence idc
- The command to run once the operation is complete
true
if the action succeeds, else
false
.public boolean exists(Id id)
exists
in interface Catalog
id
- The id to check
public void exists(Id id, Continuation c)
exists
in interface Catalog
id
- The id to checkc
- The command to run once the result is availablepublic void getObject(Id id, Continuation c)
null
if
there is no cooresponding object (through receiveResult on c).
getObject
in interface Catalog
id
- The id of the object in question.c
- The command to run once the operation is completepublic void scan(IdRange range, Continuation c)
scan
in interface Catalog
c
- The command to run once the operation is completepublic IdSet scan(IdRange range)
scan
in interface Catalog
range
- The range to query
public void getTotalSize(Continuation c)
getTotalSize
in interface Catalog
c
- The command to run once the operation is complete
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |