|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.solarmetric.kodo.runtime.datacache.DataCacheStoreManager
StoreManager proxy that delegates to a data cache when possible.
Constructor Summary | |
---|---|
DataCacheStoreManager(StoreManager sm,
DataCache cache)
Constructor. |
Method Summary | |
---|---|
void |
begin()
Begin a data store transaction. |
void |
beginOptimistic()
Notification that an optimistic transaction has started. |
protected boolean |
canCache(StateManagerImpl sm)
Returns true if sm is eligible to be
enlisted in the cache; otherwise returns false . |
boolean |
checkVersion(StateManagerImpl sm)
Determine whether the given StateManager is the same version as the datastore version. |
void |
commit()
Commit the current data store transaction. |
Object |
copyDataStoreId(Object oid,
ClassMetaData meta)
Copy the given object id value. |
boolean |
exists(Object oid,
ClassMetaData meta)
Verify that the given instance exists in the data store. |
Collection |
flush(Collection states)
Flush the given state manager collection to the datastore, returning a collection of user exceptions encountered during flushing. |
DataCache |
getDataCache()
Return the cache in use. |
Class |
getDataStoreIdClass(ClassMetaData meta)
Return the class used by this StoreManager for datastore identity values. |
StoreManager |
getStoreManager()
Return the internal store manager. |
boolean |
initialize(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
Object conn)
Initialize the given StateManager. |
void |
load(StateManagerImpl sm,
Object conn,
BitSet fields,
boolean setVersion)
Load the given StateManager. |
Object |
newDataStoreId(ClassMetaData meta)
Create a new unique datastore identity for the given type. |
Object |
newDataStoreId(String str,
ClassMetaData meta)
Create a new unique datastore identity for the given type from the given string. |
Extent |
newExtent(ClassMetaData meta,
boolean subclasses)
Return an extent of the given candidate class, optionally including subclasses. |
com.solarmetric.kodo.query.FilterExtensions |
newFilterExtensions()
Return a FilterExtensions implementation for use in queries. |
protected com.solarmetric.kodo.runtime.PCData |
newPCData(StateManagerImpl sm)
|
Query |
newQuery(String language,
Object template)
Return a query implementation suitable for this runtime. |
void |
rollback()
Rollback the current data store transaction. |
void |
setPersistenceManager(PersistenceManagerImpl pm)
Set a reference to the corresponding PersistenceManager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataCacheStoreManager(StoreManager sm, DataCache cache)
sm
- the store manager to delegate tocache
- the cache to access for shared objectsMethod Detail |
public StoreManager getStoreManager()
public DataCache getDataCache()
public void setPersistenceManager(PersistenceManagerImpl pm)
StoreManager
setPersistenceManager
in interface StoreManager
public void beginOptimistic()
StoreManager
StoreManager.begin()
method, which will still be called
when a true data store transaction should begin.beginOptimistic
in interface StoreManager
public void begin()
StoreManager
begin
in interface StoreManager
public void commit()
StoreManager
commit
in interface StoreManager
public void rollback()
StoreManager
rollback
in interface StoreManager
public boolean exists(Object oid, ClassMetaData meta)
StoreManager
exists
in interface StoreManager
public boolean checkVersion(StateManagerImpl sm)
StoreManager
checkVersion
in interface StoreManager
com.solarmetric.kodo.runtime.StoreManager
sm
- the instance to checkpublic boolean initialize(StateManagerImpl sm, com.solarmetric.kodo.runtime.JDOState state, Object conn)
StoreManager
oid
of the
StateManager will be set, and the meta
field of the
StateManager will be set to the class of the instance to load, or
possibly one of its superclasses. Initialization involves first
calling the StateManagerImpl#setPersistenceCapable
method with
a new instance of the correct type constructed with the
JDOImplHelper#newInstance(Class,StateManager,Object)
method
(this will reset the meta
field of the StateManager if
the actual type was a subclass), then possibly loading any fields if
desired. The version information for the StateManager should also be
set via the StateManagerImpl.setVersion(java.lang.Object)
method. If this
method is called during a data store transaction, the instance should
be locked.initialize
in interface StoreManager
com.solarmetric.kodo.runtime.StoreManager
sm
- the instance to initializestate
- the JDO state to pass through to the state
manager's initialize methodconnection
- the current connection information, or null if not
given to the calling method of the persistence
managerpublic void load(StateManagerImpl sm, Object conn, BitSet fields, boolean setVersion)
StoreManager
load
in interface StoreManager
com.solarmetric.kodo.runtime.StoreManager
sm
- the instance to loadconnection
- the current connection information, or null if not
given to the calling method of the persistence
managerfields
- the fields to load; the field corrsponding to the
metadata field at each set bit position should
be loaded; additional fields can be loaded if
desired; attempting to load an additional field that
has been dirtied will cause the load to be ignored;
this bit set should not be modifiedsetVersion
- if true, the version information should also be
loaded from the db and set in the instance via
the StateManagerImpl.setVersion(java.lang.Object)
methodpublic Collection flush(Collection states)
StoreManager
StateManagerImpl.setNextVersion(java.lang.Object)
method. The current version
will roll over to this next version upon successful commit.flush
in interface StoreManager
public Class getDataStoreIdClass(ClassMetaData meta)
StoreManager
getDataStoreIdClass
in interface StoreManager
public Object copyDataStoreId(Object oid, ClassMetaData meta)
StoreManager
copyDataStoreId
in interface StoreManager
public Object newDataStoreId(ClassMetaData meta)
StoreManager
newDataStoreId
in interface StoreManager
public Object newDataStoreId(String str, ClassMetaData meta)
StoreManager
newDataStoreId
in interface StoreManager
public Extent newExtent(ClassMetaData meta, boolean subclasses)
StoreManager
newExtent
in interface StoreManager
public Query newQuery(String language, Object template)
StoreManager
newQuery
in interface StoreManager
com.solarmetric.kodo.runtime.StoreManager
the
- query language; implementations are only required to
support javax.jdo.query.JDOQL
a
- template query instance also from this StoreManager; this
instance may be null; if not null, the filter, variables,
parameters, imports, and candidate class should be copied from
the template to the returned Query instancepublic com.solarmetric.kodo.query.FilterExtensions newFilterExtensions()
StoreManager
return FilterExtensions.DefaultExtensions.newExtensions ()
newFilterExtensions
in interface StoreManager
protected com.solarmetric.kodo.runtime.PCData newPCData(StateManagerImpl sm)
protected boolean canCache(StateManagerImpl sm)
true
if sm
is eligible to be
enlisted in the cache; otherwise returns false
.
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |