|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.speedo.pm.lib.SpeedoProxyManager
Is a fractal component exporting the ProxyManager interface. This implementation delegates most of the JDO methods (javax.jdo.PersistenceManager) to the underlying TransactionPersistenceManager, the perseus component managing the concurrency, the caching and the loading aspect. In order to represents a working set (transtional or not) this PM is linked forever to an org.objectweb.speedo.workingset.api.Transaction instance. The status of this Transaction instance changes when this PM is allocated or closed, or when transaction demarcations are done through the javax.jdo.Transaction interface. This implementation uses a QueryManager for allocating CompiledQuery instance. Concerning the javax.jdo.Query implementation, this PM uses org.objectweb.speedo.query.lib.SpeedoQuery which are created each time (No pooling mechanism). The last dependencies is the JormFactory and a P
PersistenceManager
,
TransactionalPersistenceManager
,
JormFactory
,
ProxyManagerFactory
,
QueryManager
,
CompiledQuery
,
Transaction
Field Summary | |
static java.lang.String |
COMPONENT_BINDING
|
static java.lang.String |
JORM_FACTORY_BINDING
|
static java.lang.String |
LOGGER_NAME
|
static java.lang.String |
PNAME_CODER_BINDING
|
static java.lang.String |
PROXY_MANAGER_FACTORY_BINDING
|
static java.lang.String |
QUERY_MANAGER_BINDING
|
static java.lang.String |
TRANSACTION_BINDING
|
static java.lang.String |
TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING
|
Constructor Summary | |
SpeedoProxyManager()
|
Method Summary | |
void |
addUse()
Signal to the persistence maneger that it is used. |
void |
afterCompletion(int i)
|
java.lang.Object |
attachCopy(java.lang.Object detached,
boolean makeTransactional)
Apply the changes contained in the detached object to the corresponding persistent instance in the cache. |
java.util.Collection |
attachCopyAll(java.util.Collection detached,
boolean makeTransactional)
|
java.lang.Object[] |
attachCopyAll(java.lang.Object[] detached,
boolean makeTransactional)
|
void |
beforeCompletion()
|
void |
bindFc(java.lang.String s,
java.lang.Object o)
|
void |
close()
This method closes the PersistenceManager. |
Query |
createQuery(java.lang.Object o)
|
javax.jdo.Transaction |
currentTransaction()
Return the Transaction instance associated with a PersistenceManager. |
void |
deletePersistent(java.lang.Object o)
Delete the persistent instance from the data store. |
void |
deletePersistentAll(java.util.Collection pcs)
Delete a Set of instances from the data store. |
void |
deletePersistentAll(java.lang.Object[] pcs)
Delete an array of instances from the data store. |
java.lang.Object |
detachCopy(java.lang.Object o)
Make a detached copy of the persitent object o and return it. |
java.util.Collection |
detachCopyAll(java.util.Collection collection)
Create a detached copy for each element of collection (assuming each element is persistent). |
java.lang.Object[] |
detachCopyAll(java.lang.Object[] objects)
|
void |
evict(java.lang.Object o)
Mark an instance as no longer needed in the cache. |
void |
evictAll()
Mark all persistent-nontransactional instances as no longer needed in the cache. |
void |
evictAll(java.util.Collection pcs)
Mark a Set of instances as no longer needed in the cache. |
void |
evictAll(java.lang.Object[] pcs)
Mark an array of instances as no longer needed in the cache. |
java.lang.Object |
getConnectionSpec()
Retrieves the connection information to access the data store |
Extent |
getExtent(java.lang.Class persistenceCapableClass,
boolean subclasses)
Not implemented. |
java.util.Collection |
getFetchGroupHints(SpeedoProxy sp)
Compute the list of unsual fields to load using the active fetchgroups in the persistence manager and the fetchgroups defined for the proxy sp. |
java.util.Collection |
getFetchGroupHints(SpeedoProxy sp,
java.lang.Object filter)
Same as getFetchGroupHints except that the filter parameter enables to define a filter for the collection to be returned. |
java.util.Collection |
getFetchGroupHints(java.lang.String className)
|
java.util.Collection |
getFetchGroupHints(java.lang.String className,
java.lang.Object filter)
|
FetchPlan |
getFetchPlan()
|
java.util.Collection |
getFieldsToLoad(SpeedoProxy sp,
boolean onlyDirectRef)
Compute the list of fields to load using the active fetchgroups in the persistence manager and the fetchgroups defined for the proxy sp. |
java.util.Collection |
getFieldsToLoad(java.lang.String className,
boolean onlyDirectRef)
|
boolean |
getIgnoreCache()
Get the ignoreCache setting for queries. |
boolean |
getMultithreaded()
Get the current Multithreaded flag for this PersistenceManager. |
java.lang.Object |
getObjectById(java.lang.Object oid,
boolean validate)
This method locates a persistent instance in the cache of instances managed by this PersistenceManager. |
java.lang.Object |
getObjectId(java.lang.Object pc)
The ObjectId returned by this method represents the JDO identity of the instance. |
java.lang.Class |
getObjectIdClass(java.lang.Class cls)
Fetches the Null PName associated to the PBinder of the persistent class |
PersistenceManagerFactory |
getPersistenceManagerFactory()
|
Semaphore |
getSemaphore()
Retrieves the semaphore object permiting the multithreading mode. |
java.lang.Object |
getTransactionalObjectId(java.lang.Object o)
Not implemented. |
TransactionalPersistenceManager |
getTransactionalPersistenceManager()
Retrieves the TransactionalPersistenceManager used by this ProxyManager. |
java.lang.Object |
getUserObject()
The application can manage the PersistenceManager instances more easily by having an application object associated with each PersistenceManager instance. |
boolean |
isClosed()
A PersistenceManager instance can be used until it is closed. |
java.lang.String[] |
listFc()
|
java.lang.Object |
lookupFc(java.lang.String s)
|
void |
makeNontransactional(java.lang.Object o)
|
void |
makeNontransactionalAll(java.util.Collection pcs)
|
void |
makeNontransactionalAll(java.lang.Object[] pcs)
|
void |
makePersistent(java.lang.Object o)
Make the transient instance persistent in this PersistenceManager. |
void |
makePersistentAll(java.util.Collection pcs)
Make a Set of instances persistent. |
void |
makePersistentAll(java.lang.Object[] pcs)
Make an array of instances persistent. |
void |
makeTransactional(java.lang.Object o)
Make an instance subject to transactional boundaries. |
void |
makeTransactionalAll(java.util.Collection pcs)
Make a Set of instances subject to transactional boundaries. |
void |
makeTransactionalAll(java.lang.Object[] pcs)
Make an array of instances subject to transactional boundaries. |
void |
makeTransient(java.lang.Object o)
Make an instance transient, removing it from management by this PersistenceManager. |
void |
makeTransientAll(java.util.Collection pcs)
Make a Set of instances transient, removing them from management by this PersistenceManager. |
void |
makeTransientAll(java.lang.Object[] pcs)
Make an array of instances transient, removing them from management by this PersistenceManager. |
java.lang.Object |
newObjectIdInstance(java.lang.Class aClass,
java.lang.String s)
|
Query |
newQuery()
Create a new Query with no elements. |
Query |
newQuery(java.lang.Class cls)
Create a new Query specifying the Class of the candidate instances. |
Query |
newQuery(java.lang.Class cls,
java.util.Collection cln)
Create a new Query with the Class of the candidate instances and candidate Set. |
Query |
newQuery(java.lang.Class cls,
java.util.Collection cln,
java.lang.String filter)
Create a new Query with the Class of the candidate instances, candidate Set, and filter. |
Query |
newQuery(Extent extent,
java.lang.String filter)
|
Query |
newQuery(java.lang.Object compiled)
Create a new Query using elements from another Query. |
Query |
newQuery(java.lang.String language,
java.lang.Object query)
Create a new Query using the specified language. |
void |
open(java.lang.Object connectionspec)
Opens the persistent manager. |
void |
refresh(java.lang.Object o)
Refresh the state of the instance from the data store. |
void |
refreshAll()
Refresh the state of all applicable instances from the data store. |
void |
refreshAll(java.util.Collection pcs)
Refresh the state of a Set of instances from the data store. |
void |
refreshAll(java.lang.Object[] pcs)
Refresh the state of an array of instances from the data store. |
void |
retrieve(java.lang.Object o)
|
void |
retrieveAll(java.util.Collection pcs)
|
void |
retrieveAll(java.util.Collection collection,
boolean b)
|
void |
retrieveAll(java.lang.Object[] pcs)
|
void |
retrieveAll(java.lang.Object[] objects,
boolean b)
|
void |
setFetchPlan(FetchPlan fp)
Set the fetch plan associated with the persistence manager. |
void |
setIgnoreCache(boolean flag)
Set the ignoreCache parameter for queries. |
void |
setMultithreaded(boolean flag)
Set the Multithreaded flag for this PersistenceManager. |
void |
setUserObject(java.lang.Object o)
|
java.lang.Object |
speedoAttachCopy(java.lang.Object detached,
boolean makeTransactional,
java.util.Map map)
|
void |
speedoDeletePersistent(java.lang.Object o)
Delete persistent a SpeedoProxy. |
java.lang.Object |
speedoDetachCopy(SpeedoProxy sp,
java.util.Map map,
java.util.Collection fgHints)
Same as detachCopy(Object detached), but uses a map to avoid cycles when detaching objects referencing each other |
java.lang.Object |
speedoGetObjectById(java.lang.Object oid,
boolean validate)
is the same method than PersistenceManager.getObjectById(Object, boolean) but no checking is done, because this is an internal call of Speedo. |
void |
speedoMakePersistent(SpeedoProxy sp,
boolean byAttach)
Make persistent a SpeedoProxy. |
void |
speedoRefresh(SpeedoProxy sp,
java.util.Map map,
java.util.Collection fgHints)
|
void |
unbindFc(java.lang.String s)
|
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 PROXY_MANAGER_FACTORY_BINDING
public static final java.lang.String TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING
public static final java.lang.String QUERY_MANAGER_BINDING
public static final java.lang.String TRANSACTION_BINDING
public static final java.lang.String JORM_FACTORY_BINDING
public static final java.lang.String PNAME_CODER_BINDING
public static final java.lang.String COMPONENT_BINDING
public static final java.lang.String LOGGER_NAME
Constructor Detail |
public SpeedoProxyManager()
Method Detail |
public Query createQuery(java.lang.Object o)
public java.util.Collection getFieldsToLoad(SpeedoProxy sp, boolean onlyDirectRef)
ProxyManager
getFieldsToLoad
in interface ProxyManager
onlyDirectRef
- : if set to true, all the fields of type a.b.c or a#element or a/fg
are removed from the returned collection
public java.util.Collection getFieldsToLoad(java.lang.String className, boolean onlyDirectRef)
getFieldsToLoad
in interface ProxyManager
public java.util.Collection getFetchGroupHints(SpeedoProxy sp)
ProxyManager
getFetchGroupHints
in interface ProxyManager
public java.util.Collection getFetchGroupHints(java.lang.String className)
getFetchGroupHints
in interface ProxyManager
public java.util.Collection getFetchGroupHints(SpeedoProxy sp, java.lang.Object filter)
ProxyManager
getFetchGroupHints
in interface ProxyManager
public java.util.Collection getFetchGroupHints(java.lang.String className, java.lang.Object filter)
getFetchGroupHints
in interface ProxyManager
public java.lang.String[] listFc()
public java.lang.Object lookupFc(java.lang.String s)
public void bindFc(java.lang.String s, java.lang.Object o)
public void unbindFc(java.lang.String s)
public FetchPlan getFetchPlan()
getFetchPlan
in interface ProxyManager
public void setFetchPlan(FetchPlan fp)
ProxyManager
setFetchPlan
in interface ProxyManager
public java.lang.Class getObjectIdClass(java.lang.Class cls)
public boolean isClosed()
close()
public void close()
javax.jdo.JDOUserException
- if the transaction associated to
the persistence manager is active.
javax.jdo.JDOFatalDataStoreException
- if there is a problem while
releasing the persistence manager.public javax.jdo.Transaction currentTransaction()
public void evict(java.lang.Object o)
o
- the instance to evict from the cache.public void evictAll(java.lang.Object[] pcs)
pcs
- the array of instances to evict from the cache.
javax.jdo.JDOUserException
- if some instances cannot be removed.evict(java.lang.Object pc)
public void evictAll(java.util.Collection pcs)
pcs
- the Set of instance to evict from the cache.evict(java.lang.Object pc)
public void evictAll()
evict(java.lang.Object pc)
public void refresh(java.lang.Object o)
In an optimistic transaction, the state of instances in the cache might not match the state in the data store. This method is used to reload the state of the instance from the data store so that a subsequent commit is more likely to succeed.
Outside a transaction, this method will refresh nontransactional state.
o
- the instance to refresh.public void speedoRefresh(SpeedoProxy sp, java.util.Map map, java.util.Collection fgHints)
speedoRefresh
in interface ProxyManager
public void refreshAll(java.lang.Object[] pcs)
pcs
- the array of instances to refresh.
object.refresh(java.lang.Object pc)
public void refreshAll(java.util.Collection pcs)
pcs
- the Set of instances to refresh.refresh(java.lang.Object pc)
public void refreshAll()
If called with an active transaction, all transactional instances will be refreshed. If called outside an active transaction, all nontransactional instances will be refreshed.
refresh(java.lang.Object pc)
public Query newQuery()
public Query newQuery(java.lang.Object compiled)
All of the settings of the other Query are copied to this Query, except for the candidate Set or Extent.
compiled
- another Query from the same JDO implementation
public Query newQuery(java.lang.String language, java.lang.Object query)
language
- the language of the query parameterquery
- the query, which is of a form determined by the language
public Query newQuery(java.lang.Class cls)
cls
- the Class of the candidate instances
public Query newQuery(Extent extent, java.lang.String filter)
public Query newQuery(java.lang.Class cls, java.util.Collection cln)
cls
- the Class of resultscln
- the Set of candidate instances
public Query newQuery(java.lang.Class cls, java.util.Collection cln, java.lang.String filter)
cls
- the Class of candidate instancescln
- the Set of candidate instancesfilter
- the filter for candidate instances
public Extent getExtent(java.lang.Class persistenceCapableClass, boolean subclasses)
persistenceCapableClass
- Class of instancessubclasses
- whether to include instances of subclasses
public java.lang.Object getObjectById(java.lang.Object oid, boolean validate)
oid
- an ObjectIdvalidate
- if the existence of the instance is to be validated. The
flag is ignored in this implementation.
getObjectId(java.lang.Object pc)
,
getTransactionalObjectId(java.lang.Object pc)
public java.lang.Object speedoGetObjectById(java.lang.Object oid, boolean validate)
ProxyManager
speedoGetObjectById
in interface ProxyManager
oid
- is an object representing an persistent object.public java.lang.Object getObjectId(java.lang.Object pc)
pc
- the PersistenceCapable instance
getTransactionalObjectId(java.lang.Object pc)
,
getObjectById(java.lang.Object oid, boolean validate)
public java.lang.Object getTransactionalObjectId(java.lang.Object o)
If the object identity is being changed in the transaction, by the application modifying one or more of the application key fields, then this method returns the current identity in the transaction.
If there is no transaction in progress, or if none of the key fields is being modified, then this method will return the same value as getObjectId.
o
- a PersistenceCapable instance
getObjectId(java.lang.Object pc)
,
getObjectById(java.lang.Object oid, boolean validate)
public void makePersistent(java.lang.Object o)
o
- a transient instance of a Class that implements
PersistenceCapablepublic void speedoMakePersistent(SpeedoProxy sp, boolean byAttach)
ProxyManager
speedoMakePersistent
in interface ProxyManager
sp
- is the instance to make persistent.byAttach
- is a boolean value indicating if the instance to make
persistent becomes persistent because the instance is linked/attached to
a persistent object (true), or because the user calls explicitly
pm.makePersistent(Obj) (false).public void makePersistentAll(java.lang.Object[] pcs)
pcs
- an array of transient instances
javax.jdo.JDOUserException
- if an object cannot be made persistent.makePersistent(java.lang.Object pc)
public void makePersistentAll(java.util.Collection pcs)
pcs
- a Set of transient instancesmakePersistent(java.lang.Object pc)
public void deletePersistent(java.lang.Object o)
o
- a persistent instance
javax.jdo.JDOUserException
- if the instance is transient or managed by
another PersistenceManager.public void speedoDeletePersistent(java.lang.Object o)
ProxyManager
speedoDeletePersistent
in interface ProxyManager
o
- is the instance to make persistent.public void deletePersistentAll(java.lang.Object[] pcs)
pcs
- a Set of persistent instancesdeletePersistent(java.lang.Object pc)
public void deletePersistentAll(java.util.Collection pcs)
pcs
- a Set of persistent instancesdeletePersistent(java.lang.Object pc)
public void makeTransient(java.lang.Object o)
The instance loses its JDO identity and it is no longer associated with any PersistenceManager. The state of fields is preserved unchanged.
o
- the instance to make transient.
javax.jdo.JDOUserException
- if the instance is dirty.public void makeTransientAll(java.lang.Object[] pcs)
pcs
- the instances to make transient.makeTransient(java.lang.Object pc)
public void makeTransientAll(java.util.Collection pcs)
The instances lose their JDO identity and they are no longer associated with any PersistenceManager. The state of fields is preserved unchanged.
pcs
- the instances to make transient.public void makeTransactional(java.lang.Object o)
o
- the instance to make transactional.PersistenceManager
public void makeTransactionalAll(java.lang.Object[] pcs)
pcs
- the array of instances to make transactional.makeTransactional(java.lang.Object pc)
public void makeTransactionalAll(java.util.Collection pcs)
pcs
- the Set of instances to make transactional.makeTransactional(java.lang.Object pc)
public void makeNontransactional(java.lang.Object o)
public void makeNontransactionalAll(java.lang.Object[] pcs)
public void makeNontransactionalAll(java.util.Collection pcs)
public void setUserObject(java.lang.Object o)
public java.lang.Object getUserObject()
setUserObject(java.lang.Object)
public PersistenceManagerFactory getPersistenceManagerFactory()
public void setMultithreaded(boolean flag)
flag
- the Multithreaded setting.public boolean getMultithreaded()
setMultithreaded(boolean)
public void setIgnoreCache(boolean flag)
flag
- the ignoreCache setting.public boolean getIgnoreCache()
setIgnoreCache(boolean)
public java.lang.Object newObjectIdInstance(java.lang.Class aClass, java.lang.String s)
public void retrieve(java.lang.Object o)
public void retrieveAll(java.util.Collection pcs)
public void retrieveAll(java.lang.Object[] pcs)
public void retrieveAll(java.util.Collection collection, boolean b)
public void retrieveAll(java.lang.Object[] objects, boolean b)
public java.lang.Object detachCopy(java.lang.Object o)
detachCopy
in interface ProxyManager
o
-
public java.lang.Object speedoDetachCopy(SpeedoProxy sp, java.util.Map map, java.util.Collection fgHints)
ProxyManager
speedoDetachCopy
in interface ProxyManager
public java.util.Collection detachCopyAll(java.util.Collection collection)
detachCopyAll
in interface ProxyManager
collection
-
public java.lang.Object[] detachCopyAll(java.lang.Object[] objects)
detachCopyAll
in interface ProxyManager
public java.lang.Object attachCopy(java.lang.Object detached, boolean makeTransactional)
attachCopy
in interface ProxyManager
detached
- makeTransactional
-
public java.lang.Object speedoAttachCopy(java.lang.Object detached, boolean makeTransactional, java.util.Map map)
speedoAttachCopy
in interface ProxyManager
public java.util.Collection attachCopyAll(java.util.Collection detached, boolean makeTransactional)
attachCopyAll
in interface ProxyManager
public java.lang.Object[] attachCopyAll(java.lang.Object[] detached, boolean makeTransactional)
attachCopyAll
in interface ProxyManager
public TransactionalPersistenceManager getTransactionalPersistenceManager()
ProxyManager
getTransactionalPersistenceManager
in interface ProxyManager
public void open(java.lang.Object connectionspec)
ProxyManager
open
in interface ProxyManager
connectionspec
- is the information to access to the data store
(user, password, ...)public java.lang.Object getConnectionSpec()
ProxyManager
getConnectionSpec
in interface ProxyManager
public void addUse()
ProxyManager
addUse
in interface ProxyManager
public void beforeCompletion()
public void afterCompletion(int i)
public Semaphore getSemaphore()
ProxyManager
getSemaphore
in interface ProxyManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |