|
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.PersistenceManagerImpl
Concrete PersistenceManager for use with
this common runtime. The PersistenceManager handles JDO-specific
behavior, but leaves all interaction with the data store to
a StoreManager that must be supplied at initialization.
All options defined in the JDO 1.0 specification are supported, with the exception of non durable identity and changing primary keys.
| Field Summary | |
|---|---|
protected StoreManager |
store
The store manager in use; this may be a decorator such as a DataCacheStoreManager around the native store manager. |
| Constructor Summary | |
|---|---|
PersistenceManagerImpl()
|
|
| Method Summary | |
|---|---|
void |
begin()
|
void |
checkActiveTransaction()
|
void |
checkClosed()
|
void |
checkNontransactionalRead()
|
protected StateManagerImpl |
checkValid(Object pc)
|
void |
close()
|
protected void |
closeQueries()
Close all open queries. |
void |
commit()
|
void |
commitAndResume()
API extension. |
Transaction |
currentTransaction()
Obtain the PersistenceManager's current transaction. |
void |
deletePersistent(Object pc)
|
void |
deletePersistentAll(Collection pcs)
|
void |
deletePersistentAll(Object[] pcs)
|
protected void |
deletePersistentFilter(Object pc)
Delete the given persistent instance. |
protected void |
endTransaction(boolean rollback)
|
void |
evict(Object pc)
|
void |
evictAll()
|
void |
evictAll(Class cls)
API extension. |
void |
evictAll(Collection pcs)
|
void |
evictAll(Extent extent)
API extension. |
void |
evictAll(Object[] pcs)
|
protected void |
evictFilter(Object pc)
Evict the given instance. |
protected void |
finalize()
|
protected void |
flush()
|
Object |
getCachedObjectById(Object oid)
API extension. |
JDOClassResolver |
getClassResolver(Class cls)
Returns a JDOClassResolver appropriate for use with
cls. |
JDOClassResolver |
getClassResolver(ClassLoader l)
Returns a JDOClassResolver appropriate for use with
l. |
JDOClassResolver |
getClassResolver(StateManagerImpl sm)
Returns a JDOClassResolver appropriate for use with
sm. |
Configuration |
getConfiguration()
Return the JDO configuration for the persistence manager. |
String |
getConnectionPassword()
Return the password given on construction. |
String |
getConnectionUserName()
Return the user name given on construction. |
ClassLoader |
getContextClassLoader()
|
Extent |
getExtent(Class type,
boolean subclasses)
|
boolean |
getIgnoreCache()
|
Collection |
getManagedObjects()
API Extension. |
boolean |
getMultithreaded()
|
boolean |
getNontransactionalRead()
|
boolean |
getNontransactionalWrite()
|
Object |
getObjectById(Object oid,
boolean validate)
|
Object |
getObjectById(Object oid,
Object connection)
API extension. |
protected Object |
getObjectByIdFilter(Object oid,
Object connection,
boolean validate,
boolean copyOid,
boolean getNewObjects)
|
Object |
getObjectId(Object pc)
|
Class |
getObjectIdClass(Class cls)
|
boolean |
getOptimistic()
|
PersistenceManager |
getPersistenceManager()
|
PersistenceManagerFactory |
getPersistenceManagerFactory()
|
boolean |
getRestoreValues()
|
boolean |
getRetainValues()
|
StateManagerImpl |
getState(Object oid)
API extension. |
protected StateManagerImpl |
getState(Object oid,
boolean getNewObjects)
API extension. |
StoreManager |
getStoreManager()
API extension. |
Synchronization |
getSynchronization()
|
Object |
getTransactionalObjectId(Object pc)
|
Collection |
getTransactionalObjects()
API Extension. |
Object |
getUserObject()
|
void |
initialize(PersistenceManagerFactoryImpl factory,
StoreManager sm,
String user,
String pass)
Initialize the persistence manager. |
boolean |
isActive()
|
boolean |
isClosed()
|
protected void |
lock()
Synchronizes on an internal lock if the Multithreaded flag is set to true. |
void |
makeNontransactional(Object pc)
|
void |
makeNontransactionalAll(Collection pcs)
|
void |
makeNontransactionalAll(Object[] pcs)
|
protected void |
makeNontransactionalFilter(Object pc)
Make the given instance non-transactional. |
void |
makePersistent(Object pc)
|
void |
makePersistentAll(Collection pcs)
|
void |
makePersistentAll(Object[] pcs)
|
protected void |
makePersistentFilter(Object pc)
Make the given instance persistent. |
void |
makeTransactional(Object pc)
|
void |
makeTransactionalAll(Collection pcs)
|
void |
makeTransactionalAll(Object[] pcs)
|
protected void |
makeTransactionalFilter(Object pc)
Make the given instance transactional. |
void |
makeTransient(Object pc)
|
void |
makeTransientAll(Collection pcs)
|
void |
makeTransientAll(Object[] pcs)
|
protected void |
makeTransientFilter(Object pc)
Make the given instance transient. |
protected void |
markTransactionalObjectDirty(StateManagerImpl sm)
|
protected Map |
newManagedObjectCache()
Create a new Map to be used for the managed object
cache. |
Object |
newObjectIdInstance(Class cls,
String str)
|
Query |
newQuery()
|
Query |
newQuery(Class cls)
|
Query |
newQuery(Class cls,
Collection cln)
|
Query |
newQuery(Class cls,
Collection cln,
String filter)
|
Query |
newQuery(Class cls,
String filter)
|
Query |
newQuery(Extent ext)
|
Query |
newQuery(Extent ext,
String filter)
|
Query |
newQuery(Object compiled)
|
Query |
newQuery(String language,
Object compiled)
|
void |
refresh(Object pc)
|
void |
refreshAll()
|
void |
refreshAll(Collection pcs)
|
void |
refreshAll(Object[] pcs)
|
protected void |
refreshFilter(Object pc)
Refresh the given instance. |
Class |
resolvePersistentClass(Class c)
Resolve an interface or abstract class to a concrete persistent subclass. |
void |
retrieve(Object pc)
|
void |
retrieveAll(Collection pcs)
|
void |
retrieveAll(Object[] pcs)
|
protected void |
retrieveFilter(Object pc)
Retrieve the persistent state of the given instance. |
void |
rollback()
|
void |
rollbackAndResume()
API extension. |
void |
setIgnoreCache(boolean val)
|
void |
setMultithreaded(boolean multiThreaded)
|
void |
setNontransactionalRead(boolean val)
|
void |
setNontransactionalWrite(boolean val)
|
void |
setOptimistic(boolean val)
|
void |
setRestoreValues(boolean val)
|
void |
setRetainValues(boolean val)
|
void |
setSynchronization(Synchronization synch)
|
void |
setUserObject(Object o)
|
protected void |
unlock()
Releases the internal lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected StoreManager store
DataCacheStoreManager around the native store manager.| Constructor Detail |
public PersistenceManagerImpl()
| Method Detail |
public void initialize(PersistenceManagerFactoryImpl factory,
StoreManager sm,
String user,
String pass)
factory - the PersistenceManagerFactory used to create
this PersistenceManagerstore - a concrete StoreManager implementation to
handle interaction with the data storeuser - the username this PersistenceManager represents;
used when pooling managers to make sure that
a request to the PersistenceManagerFactory for
a connection with an explicit user is
delegated to a suitable PersistenceManagerpass - the password for the above userprotected Map newManagedObjectCache()
Map to be used for the managed object
cache. By default, this creates a CacheMap if the
factory's configuration's cache reference size is greater than
or equal to 0, or a HashMap with an initial capacity
of 1000 if the cache reference size is less than 0.public PersistenceManager getPersistenceManager()
getPersistenceManager in interface Transactionpublic boolean getNontransactionalRead()
getNontransactionalRead in interface Transactionpublic void setNontransactionalRead(boolean val)
setNontransactionalRead in interface Transactionpublic boolean getNontransactionalWrite()
getNontransactionalWrite in interface Transactionpublic void setNontransactionalWrite(boolean val)
setNontransactionalWrite in interface Transactionpublic boolean getOptimistic()
getOptimistic in interface Transactionpublic void setOptimistic(boolean val)
setOptimistic in interface Transactionpublic boolean getRetainValues()
getRetainValues in interface Transactionpublic void setRetainValues(boolean val)
setRetainValues in interface Transactionpublic boolean getRestoreValues()
getRestoreValues in interface Transactionpublic void setRestoreValues(boolean val)
setRestoreValues in interface Transactionpublic boolean getIgnoreCache()
getIgnoreCache in interface PersistenceManagerpublic void setIgnoreCache(boolean val)
setIgnoreCache in interface PersistenceManagerpublic void begin()
begin in interface Transactionpublic void commitAndResume()
pm.currentTransaction ().commit (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.commit(),
Transaction.begin()public void rollbackAndResume()
pm.currentTransaction ().rollback (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
Transaction.rollback(),
Transaction.begin()public void commit()
commit in interface Transactionpublic void rollback()
rollback in interface Transactionpublic Synchronization getSynchronization()
getSynchronization in interface Transactionpublic void setSynchronization(Synchronization synch)
setSynchronization in interface Transactionpublic boolean isActive()
isActive in interface Transactionprotected void flush()
protected void endTransaction(boolean rollback)
public PersistenceManagerFactory getPersistenceManagerFactory()
getPersistenceManagerFactory in interface PersistenceManagerpublic Configuration getConfiguration()
public String getConnectionUserName()
public String getConnectionPassword()
public Object getUserObject()
getUserObject in interface PersistenceManagerpublic void setUserObject(Object o)
setUserObject in interface PersistenceManagerpublic boolean getMultithreaded()
getMultithreaded in interface PersistenceManagerpublic void setMultithreaded(boolean multiThreaded)
setMultithreaded in interface PersistenceManagerpublic boolean isClosed()
isClosed in interface PersistenceManager
protected void finalize()
throws Throwable
finalize in class Objectpublic void close()
close in interface PersistenceManagerprotected void closeQueries()
public Transaction currentTransaction()
currentTransaction in interface PersistenceManagerpublic Object getObjectId(Object pc)
getObjectId in interface PersistenceManagerpublic Object getTransactionalObjectId(Object pc)
getTransactionalObjectId in interface PersistenceManagerpublic Class getObjectIdClass(Class cls)
getObjectIdClass in interface PersistenceManager
public Object newObjectIdInstance(Class cls,
String str)
newObjectIdInstance in interface PersistenceManager
public Object getObjectById(Object oid,
boolean validate)
getObjectById in interface PersistenceManager
public Object getObjectById(Object oid,
Object connection)
protected Object getObjectByIdFilter(Object oid,
Object connection,
boolean validate,
boolean copyOid,
boolean getNewObjects)
public Object getCachedObjectById(Object oid)
oid - the object's id, or a persistence-capable instance with
the same id (possibly from another persistence manager)public void makePersistentAll(Collection pcs)
makePersistentAll in interface PersistenceManagerpublic void makePersistentAll(Object[] pcs)
makePersistentAll in interface PersistenceManagerpublic void makePersistent(Object pc)
makePersistent in interface PersistenceManagerprotected void makePersistentFilter(Object pc)
public void deletePersistentAll(Collection pcs)
deletePersistentAll in interface PersistenceManagerpublic void deletePersistentAll(Object[] pcs)
deletePersistentAll in interface PersistenceManagerpublic void deletePersistent(Object pc)
deletePersistent in interface PersistenceManagerprotected void deletePersistentFilter(Object pc)
public void makeNontransactionalAll(Collection pcs)
makeNontransactionalAll in interface PersistenceManagerpublic void makeNontransactionalAll(Object[] pcs)
makeNontransactionalAll in interface PersistenceManagerpublic void makeNontransactional(Object pc)
makeNontransactional in interface PersistenceManagerprotected void makeNontransactionalFilter(Object pc)
public void makeTransactionalAll(Collection pcs)
makeTransactionalAll in interface PersistenceManagerpublic void makeTransactionalAll(Object[] pcs)
makeTransactionalAll in interface PersistenceManagerpublic void makeTransactional(Object pc)
makeTransactional in interface PersistenceManagerprotected void makeTransactionalFilter(Object pc)
public void makeTransientAll(Collection pcs)
makeTransientAll in interface PersistenceManagerpublic void makeTransientAll(Object[] pcs)
makeTransientAll in interface PersistenceManagerpublic void makeTransient(Object pc)
makeTransient in interface PersistenceManagerprotected void makeTransientFilter(Object pc)
public void refreshAll()
refreshAll in interface PersistenceManagerpublic void refreshAll(Collection pcs)
refreshAll in interface PersistenceManagerpublic void refreshAll(Object[] pcs)
refreshAll in interface PersistenceManagerpublic void refresh(Object pc)
refresh in interface PersistenceManagerprotected void refreshFilter(Object pc)
public void retrieveAll(Collection pcs)
retrieveAll in interface PersistenceManagerpublic void retrieveAll(Object[] pcs)
retrieveAll in interface PersistenceManagerpublic void retrieve(Object pc)
retrieve in interface PersistenceManagerprotected void retrieveFilter(Object pc)
public void evictAll()
evictAll in interface PersistenceManagerpublic void evictAll(Collection pcs)
evictAll in interface PersistenceManagerpublic void evictAll(Object[] pcs)
evictAll in interface PersistenceManagerpublic void evict(Object pc)
evict in interface PersistenceManagerpublic void evictAll(Class cls)
Evict all persistent-clean and persistent-nontransactional instances of the given class. The state of any cached instances will be cleared, and they will transition to hollow. Any strong references to the instances will be cleared.
This method should only be called after checking that the persistence manager is not closed.
JDOUserException - if cls is null or does
not implement PersistenceCapablepublic void evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional
instances in the given Extent. The state of any cached
instances will be cleared, and they will transition to hollow.
Any strong references to the instances will be cleared.
This method should only be called after checking that the persistence manager is not closed.
JDOUserException - if extent is null or does
not implement PersistenceCapableprotected void evictFilter(Object pc)
public Extent getExtent(Class type,
boolean subclasses)
getExtent in interface PersistenceManagerpublic Query newQuery()
newQuery in interface PersistenceManagerpublic Query newQuery(Class cls)
newQuery in interface PersistenceManager
public Query newQuery(Class cls,
Collection cln)
newQuery in interface PersistenceManagerpublic Query newQuery(Extent ext)
newQuery in interface PersistenceManager
public Query newQuery(Class cls,
Collection cln,
String filter)
newQuery in interface PersistenceManager
public Query newQuery(Extent ext,
String filter)
newQuery in interface PersistenceManager
public Query newQuery(Class cls,
String filter)
newQuery in interface PersistenceManagerpublic Query newQuery(Object compiled)
newQuery in interface PersistenceManager
public Query newQuery(String language,
Object compiled)
newQuery in interface PersistenceManagerprotected final void lock()
Multithreaded flag is set to true. Make sure to call
unlock() in a finally clause of the same method.protected final void unlock()
public StoreManager getStoreManager()
public StateManagerImpl getState(Object oid)
protected StateManagerImpl getState(Object oid,
boolean getNewObjects)
getNewObjects - If true, consider PNEW
objects. Otherwise, only examine
non-new objects. When loading data
from the data store, we never want to
look up new objects -- we can never
get a new object id from the data
store.public Collection getManagedObjects()
public Collection getTransactionalObjects()
protected void markTransactionalObjectDirty(StateManagerImpl sm)
public void checkClosed()
public void checkActiveTransaction()
public void checkNontransactionalRead()
protected StateManagerImpl checkValid(Object pc)
public Class resolvePersistentClass(Class c)
JDOUserException - when no concrete subclasses are
known, or there are multiple
concrete subclasses.public ClassLoader getContextClassLoader()
public JDOClassResolver getClassResolver(StateManagerImpl sm)
JDOClassResolver appropriate for use with
sm.public JDOClassResolver getClassResolver(Class cls)
JDOClassResolver appropriate for use with
cls.public JDOClassResolver getClassResolver(ClassLoader l)
JDOClassResolver appropriate for use with
l.
|
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 | |||||||||