|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.ObjectManagerImpl
public class ObjectManagerImpl
Representation of an ObjectManager. An object manager provides management for the persistence of objects into a datastore and the retrieval of these objects using various methods.
An ObjectManager has its own Level 1 cache. This stores objects against their identity. The Level 1 Cache is typically a weak referenced map and so cached objects can be garbage collected. Objects are similarly placed in the Level 2 cache of the owning PersistenceManagerFactory. This Level 2 cache caches objects across multiple ObjectManagers, and so we can use this to get objects retrieved by other ObjectManagers. The Caches exist for performance enhancement.
Has a single transaction (the "current" transaction).
When an object involved in the current transaction it is enlisted (calling enlistInTransaction()). Its' identity is saved (in "txEnlistedIds") for use later in any "persistenceByReachability" process run at commit. Any object that is passed via makePersistent() will be stored (as an identity) in "txKnownPersistedIds" and objects persisted due to reachability from these objects will also have their identity stored (in "txFlushedNewIds"). All of this information is used in the "persistence-by-reachability-at-commit" process which detects if some objects originally persisted are no longer reachable and hence should not be persistent after all.
ALl queries run during a transaction are registered here. When the transaction commits/rolls back then all queries are notified that the connection is closing so that they can read in any remaining results (and the queries remain usable after). When this manager closes all queries registered here will also be closed meaning that a query has its lifetime defined by the owning PersistenceManager.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jpox.ObjectManager |
|---|
ObjectManager.ObjectManagerListener |
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
Localisation utility for output messages |
| Constructor Summary | |
|---|---|
ObjectManagerImpl(ObjectManagerFactoryImpl omf,
java.lang.Object owner,
java.lang.String userName,
java.lang.String password)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addListener(java.lang.Object listener,
java.lang.Class[] classes)
Method to register a listener for instances of the specified classes. |
void |
addStateManager(StateManager sm)
Method to add the object managed by the specified StateManager to the cache. |
protected void |
assertActiveTransaction()
Method to assert if the current transaction is active. |
void |
assertClassPersistable(java.lang.Class cls)
Method to assert if the specified class is Persistence Capable. |
protected void |
assertDetachable(java.lang.Object object)
Method to assert if the specified object is Detachable. |
protected void |
assertHasImplementationCreator()
Validates that an ImplementationCreator instance is accessible. |
protected void |
assertIsOpen()
Method to assert if this Object Manager is open. |
protected void |
assertNotDetached(java.lang.Object object)
Method to assert if the specified object is detached. |
protected void |
assertWritable()
Method to assert if the current transaction is active or non transactional writes are allowed. |
void |
attachObject(java.lang.Object pc,
boolean sco)
Method to attach a persistent detached object. |
java.lang.Object |
attachObjectCopy(java.lang.Object pc,
boolean sco)
Method to attach a persistent detached object returning an attached copy of the object. |
void |
clearDirty()
Method to clear all objects marked as dirty (whether directly or indirectly). |
void |
clearDirty(StateManager sm)
Method to clear an object from the list of dirty objects. |
void |
close()
Method to close the Persistence Manager. |
void |
deleteObject(java.lang.Object obj)
Method to delete an object from the datastore. |
void |
deleteObjectInternal(java.lang.Object obj)
Method to delete an object from persistence which should be called from internal calls only. |
void |
deleteObjects(java.util.Collection objs)
Method to delete an array of objects from the datastore. |
void |
deleteObjects(java.lang.Object[] objs)
Method to delete an array of objects from the datastore. |
void |
detachAll()
Method to detach all objects in the ObjectManager. |
void |
detachObject(java.lang.Object obj,
FetchPlanState state)
Method to detach a persistent object without making a copy. |
java.lang.Object |
detachObjectCopy(java.lang.Object pc,
FetchPlanState state)
Detach a copy of the passed persistent object using the provided detach state. |
void |
disconnectLifecycleListener()
Disconnect the registered LifecycleListener |
void |
disconnectSMCache()
Disconnect SM instances, clear cache and reset settings |
void |
enlistInTransaction(StateManager sm)
Method to enlist the specified StateManager in the current transaction. |
void |
evictAllObjects()
Method to evict all current objects from L1 cache. |
void |
evictFromTransaction(StateManager sm)
Method to evict the specified StateManager from the current transaction. |
void |
evictObject(java.lang.Object obj)
Internal method to evict an object from L1 cache. |
void |
evictObjects(java.lang.Class cls,
boolean subclasses)
Method to evict all objects of the specified type (and optionaly its subclasses). |
boolean |
exists(java.lang.Object obj)
Method to return if the specified object exists in the datastore. |
java.lang.Object |
findObject(java.lang.Object id,
boolean validate,
boolean checkInheritance,
java.lang.String objectClassName)
Accessor for an object given the object id. |
java.lang.Object |
findObject(java.lang.Object id,
FieldValues fv)
Accessor for an object given the object id. |
java.lang.Object |
findObject(java.lang.Object id,
FieldValues fv,
java.lang.Class cls,
boolean ignoreCache)
Accessor for an object given the object id. |
java.lang.Object |
findObjectUsingAID(java.lang.Class pcClass,
FieldValues fv,
boolean ignoreCache,
boolean checkInheritance)
Accessor for the StateManager of an object given the object AID. |
StateManager |
findStateManager(java.lang.Object pc)
Method to find the StateManager for an object. |
void |
flush()
Method callable from external APIs for user-management of flushing. |
void |
flushInternal(boolean flushToDatastore)
This method flushes all dirty, new, and deleted instances to the datastore. |
ApiAdapter |
getApiAdapter()
Accessor for the API adapter. |
CallbackHandler |
getCallbackHandler()
Retrieve the callback handler for this ObjectManager. |
ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the ClassLoaderResolver |
boolean |
getCopyOnAttach()
Accessor for whether to copy on attaching. |
boolean |
getDetachAllOnCommit()
Accessor for whether to detach all objects on commit of the transaction. |
boolean |
getDetachOnClose()
Accessor for whether to detach objects on close of the ObjectManager. |
Extent |
getExtent(java.lang.Class pcClass,
boolean subclasses)
Extents are collections of datastore objects managed by the datastore, not by explicit user operations on collections. |
FetchPlan |
getFetchPlan()
Acessor for the current FetchPlan |
boolean |
getIgnoreCache()
Accessor for whether to ignore the cache. |
java.util.Set |
getManagedObjects()
Accessor for the currently managed objects for the current transaction. |
java.util.Set |
getManagedObjects(java.lang.Class[] classes)
Accessor for the currently managed objects for the current transaction. |
java.util.Set |
getManagedObjects(java.lang.String[] states)
Accessor for the currently managed objects for the current transaction. |
java.util.Set |
getManagedObjects(java.lang.String[] states,
java.lang.Class[] classes)
Accessor for the currently managed objects for the current transaction. |
MetaDataManager |
getMetaDataManager()
Accessor for the MetaDataManager for this ObjectManager (and its factory). |
boolean |
getMultithreaded()
Accessor for whether the Persistence Manager is multithreaded. |
java.lang.Object |
getObjectFromCache(java.lang.Object id)
Convenience method to access an object in the cache. |
OMFContext |
getOMFContext()
Gets the context in which this ObjectManager is running |
java.lang.Object |
getOwner()
Method to return the owner PM/EM object. |
StateManager |
getStateManagerById(java.lang.Object id)
Accessor for the StateManager of an object given the object id. |
StoreManager |
getStoreManager()
Accessor for the Store Manager. |
protected org.jpox.ObjectManagerImpl.ThreadContextInfo |
getThreadContextInfo()
Accessor for the thread context information, for the current thread. |
Transaction |
getTransaction()
Accessor for the current transaction. |
boolean |
hasPersistenceInformationForClass(java.lang.Class cls)
Utility method to check if the specified class has reachable metadata or annotations. |
void |
hereIsStateManager(StateManager sm,
java.lang.Object pc)
Method to add the StateManager for an object to this ObjectManager's list. |
protected void |
initialiseLevel1Cache()
Method to initialise the L1 cache. |
boolean |
isClosed()
Accessor for whether this ObjectManager is closed. |
boolean |
isDelayDatastoreOperationsEnabled()
Whether the datastore operations are delayed until commit/flush. |
boolean |
isEnlistedInTransaction(java.lang.Object id)
Method to return if an object is enlisted in the current transaction. |
boolean |
isFlushing()
Returns whether the ObjectManager is in the process of flushing. |
boolean |
isInserted(java.lang.Object pc,
int fieldNumber)
Convenience method to find if the specified field of the specified object has been inserted yet. |
boolean |
isInserted(java.lang.Object pc,
java.lang.String className)
Convenience method to find if the specified object is inserted down to the specified class level yet. |
boolean |
isInserting(java.lang.Object pc)
Tests whether this persistable object is in the process of being inserted. |
boolean |
isManagingRelations()
Returns whether this ObjectManager is currently performing the manage relationships task. |
boolean |
isRunningDetachAllOnCommit()
Accessor for whether this ObjectManager is currently running detachAllOnCommit. |
void |
makeObjectNontransactional(java.lang.Object obj)
Method to make an object nontransactional. |
void |
makeObjectTransactional(java.lang.Object obj)
Method to make an object transactional. |
void |
makeObjectTransient(java.lang.Object obj,
FetchPlanState state)
Method to migrate an object to transient state. |
void |
markDirty(StateManager sm,
boolean directUpdate)
Method to mark an object (StateManager) as dirty. |
void |
markManagedRelationDirty(StateManager sm)
Method to mark the specified StateManager as needing an update due to managed relation constraints. |
java.lang.Object |
newInstance(java.lang.Class cls)
Method to generate an instance of an interface, abstract class, or concrete PC class. |
java.lang.Object |
newObjectId(java.lang.Class pcClass,
java.lang.Object key)
This method returns an object id instance corresponding to the pcClass and key arguments. |
java.lang.Object |
newObjectId(java.lang.String className,
java.lang.Object pc)
This method returns an object id instance corresponding to the class name, and the passed object (when using app identity). |
Query |
newQuery()
Construct an empty query instance. |
protected void |
performManagedRelationships()
Method to perform managed relationships tasks. |
java.lang.Object |
persistObject(java.lang.Object obj)
Method to make an object persistent. |
java.lang.Object |
persistObjectInternal(java.lang.Object obj,
FieldValues preInsertChanges,
StateManager ownerSM,
int ownerFieldNum,
int objectType)
Method to make an object persistent which should be called from internal calls only. |
void |
postBegin()
Method to perform any post-begin checks. |
void |
postClose()
Method called during the close process. |
void |
postCommit()
Commit any changes made to objects managed by the persistence manager to the database. |
void |
preCommit()
Method to perform any pre-commit checks. |
void |
preRollback()
Rollback any changes made to objects managed by the persistence manager to the database. |
void |
putObjectIntoCache(StateManager sm,
boolean level1,
boolean level2)
Convenience method to add an object to the cache(s). |
void |
refreshAllObjects()
Method to do a refresh of all objects. |
void |
refreshObject(java.lang.Object obj)
Method to do a refresh of an object, updating it from its datastore representation. |
void |
removeAllInstanceLifecycleListeners()
This method removes all previously registered lifecycle listeners. |
void |
removeListener(java.lang.Object listener)
Method to remove a currently registered listener. |
void |
removeObjectFromCache(java.lang.Object pc,
java.lang.Object id,
boolean level1,
boolean level2)
Convenience method to evict an object from the cache(s). |
void |
removeStateManager(StateManager sm)
Method to remove the object managed by the specified StateManager from the cache. |
protected void |
removeThreadContextInfo()
Method to remove the current thread context info for the current thread. |
void |
replaceObjectId(java.lang.Object pc,
java.lang.Object oldID,
java.lang.Object newID)
Replace the previous object id for a persistable object with a new one. |
void |
retrieveObject(java.lang.Object obj,
boolean fgOnly)
Method to retrieve an object. |
void |
setCopyOnAttach(boolean flag)
Mutator for whether to copy on attaching. |
void |
setDetachAllOnCommit(boolean flag)
Mutator for whether to detach all objects on commit of the transaction. |
void |
setDetachOnClose(boolean flag)
Mutator for whether to detach objects on close of the ObjectManager. |
void |
setIgnoreCache(boolean flag)
Mutator for whether to ignore the cache. |
void |
setMultithreaded(boolean flag)
Mutator for whether the Persistence Manager is multithreaded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
| Constructor Detail |
|---|
public ObjectManagerImpl(ObjectManagerFactoryImpl omf,
java.lang.Object owner,
java.lang.String userName,
java.lang.String password)
omf - Object Manager Factoryowner - The owning PM/EMuserName - Username for the datastorepassword - Password for the datastore
JPOXUserException - if an error occurs allocating the necessary requested components| Method Detail |
|---|
protected void initialiseLevel1Cache()
JPOXUserException - if an error occurs setting up the L1 cachepublic boolean isClosed()
isClosed in interface ObjectManagerpublic ClassLoaderResolver getClassLoaderResolver()
getClassLoaderResolver in interface ObjectManagerpublic StoreManager getStoreManager()
getStoreManager in interface ObjectManagerpublic ApiAdapter getApiAdapter()
getApiAdapter in interface ObjectManagerpublic FetchPlan getFetchPlan()
getFetchPlan in interface ObjectManagerpublic java.lang.Object getOwner()
getOwner in interface ObjectManagerpublic OMFContext getOMFContext()
getOMFContext in interface ObjectManagerpublic MetaDataManager getMetaDataManager()
getMetaDataManager in interface ObjectManagerpublic void setMultithreaded(boolean flag)
setMultithreaded in interface ObjectManagerflag - Whether to run multithreaded.public boolean getMultithreaded()
getMultithreaded in interface ObjectManagerpublic void setDetachOnClose(boolean flag)
setDetachOnClose in interface ObjectManagerflag - Whether to detach on close.public boolean getDetachOnClose()
public void setDetachAllOnCommit(boolean flag)
setDetachAllOnCommit in interface ObjectManagerflag - Whether to detach all on commit.public boolean getDetachAllOnCommit()
getDetachAllOnCommit in interface ObjectManagerpublic void setCopyOnAttach(boolean flag)
setCopyOnAttach in interface ObjectManagerflag - Whether to copy on attachingpublic boolean getCopyOnAttach()
getCopyOnAttach in interface ObjectManagerpublic void setIgnoreCache(boolean flag)
setIgnoreCache in interface ObjectManagerflag - Whether to ignore the cache.public boolean getIgnoreCache()
getIgnoreCache in interface ObjectManagerpublic boolean isDelayDatastoreOperationsEnabled()
isDelayDatastoreOperationsEnabled in interface ObjectManagerpublic boolean isInserting(java.lang.Object pc)
isInserting in interface ObjectManagerpc - the object to verify the status
public boolean isInserted(java.lang.Object pc,
int fieldNumber)
isInserted in interface ObjectManagerpc - The objectfieldNumber - The absolute field number
public boolean isInserted(java.lang.Object pc,
java.lang.String className)
isInserted in interface ObjectManagerpc - The objectclassName - Name of the class that we want to check the insertion level to
public Transaction getTransaction()
getTransaction in interface ObjectManagerpublic void enlistInTransaction(StateManager sm)
enlistInTransaction in interface ObjectManagersm - The StateManagerpublic void evictFromTransaction(StateManager sm)
evictFromTransaction in interface ObjectManagersm - The StateManagerpublic boolean isEnlistedInTransaction(java.lang.Object id)
isEnlistedInTransaction in interface ObjectManagerid - Identity for the object
public void addStateManager(StateManager sm)
addStateManager in interface ObjectManagersm - The StateManagerpublic void removeStateManager(StateManager sm)
removeStateManager in interface ObjectManagersm - The StateManagerpublic StateManager getStateManagerById(java.lang.Object id)
getStateManagerById in interface ObjectManagerid - Id of the object.
public StateManager findStateManager(java.lang.Object pc)
findStateManager in interface ObjectManagerpc - The object we require the StateManager for.
public void hereIsStateManager(StateManager sm,
java.lang.Object pc)
hereIsStateManager in interface ObjectManagersm - The StateManagerpc - The object managed by the StateManagerpublic void close()
close in interface ObjectManagerpublic void postClose()
ObjectManager
postClose in interface ObjectManagerpublic void disconnectSMCache()
disconnectSMCache in interface ObjectManagerpublic void evictObject(java.lang.Object obj)
evictObject in interface ObjectManagerobj - The object
JPOXException - if an error occurs evicting the object
public void evictObjects(java.lang.Class cls,
boolean subclasses)
evictObjects in interface ObjectManagercls - Type of persistable objectsubclasses - Whether to include subclassespublic void evictAllObjects()
evictAllObjects in interface ObjectManagerpublic void refreshObject(java.lang.Object obj)
refreshObject in interface ObjectManagerobj - The Objectpublic void refreshAllObjects()
refreshAllObjects in interface ObjectManagerJPOXUserException - thrown if instances could not be refreshed.
public void retrieveObject(java.lang.Object obj,
boolean fgOnly)
retrieveObject in interface ObjectManagerobj - The objectfgOnly - Whether to retrieve the current fetch group fields onlyprotected org.jpox.ObjectManagerImpl.ThreadContextInfo getThreadContextInfo()
protected void removeThreadContextInfo()
public java.lang.Object persistObject(java.lang.Object obj)
persistObject in interface ObjectManagerobj - The object
JPOXUserException - if the object is managed by a different manager
public java.lang.Object persistObjectInternal(java.lang.Object obj,
FieldValues preInsertChanges,
StateManager ownerSM,
int ownerFieldNum,
int objectType)
persistObjectInternal in interface ObjectManagerobj - The objectpreInsertChanges - Any changes to make before insertingownerSM - StateManager of the owner when embeddedownerFieldNum - Field number in the owner where this is embedded (or -1 if not embedded)objectType - Type of object (see org.jpox.StateManager, e.g StateManager.PC)
JPOXUserException - if the object is managed by a different managerpublic void deleteObject(java.lang.Object obj)
deleteObject in interface ObjectManagerobj - The objectpublic void deleteObjectInternal(java.lang.Object obj)
deleteObjectInternal in interface ObjectManagerobj - Object to deletepublic void deleteObjects(java.lang.Object[] objs)
deleteObjects in interface ObjectManagerobjs - The objects
JPOXUserException - Thrown if an error occurs during the deletion process.
Any exception could have several nested exceptions for each failed object deletionpublic void deleteObjects(java.util.Collection objs)
deleteObjects in interface ObjectManagerobjs - The objects
JPOXUserException - Thrown if an error occurs during the deletion process.
Any exception could have several nested exceptions for each failed object deletion
public void makeObjectTransient(java.lang.Object obj,
FetchPlanState state)
makeObjectTransient in interface ObjectManagerobj - The objectstate - Object containing the state of the fetch plan process (if any)
JPOXException - When an error occurs in making the object transientpublic void makeObjectTransactional(java.lang.Object obj)
makeObjectTransactional in interface ObjectManagerobj - The object
JPOXException - Thrown when an error occurspublic void makeObjectNontransactional(java.lang.Object obj)
makeObjectNontransactional in interface ObjectManagerobj - The object
public void attachObject(java.lang.Object pc,
boolean sco)
attachObject in interface ObjectManagerpc - The persistable objectsco - Whether the PC object is stored without an identity (embedded/serialised)
public java.lang.Object attachObjectCopy(java.lang.Object pc,
boolean sco)
attachObjectCopy in interface ObjectManagerpc - The objectsco - Whether it has no identity (second-class object)
public void detachObject(java.lang.Object obj,
FetchPlanState state)
detachObject in interface ObjectManagerobj - The objectstate - State for the detachment process
public java.lang.Object detachObjectCopy(java.lang.Object pc,
FetchPlanState state)
detachObjectCopy in interface ObjectManagerpc - The objectstate - State for the detachment process
public void detachAll()
detachAll in interface ObjectManagerpublic java.lang.Object newInstance(java.lang.Class cls)
newInstance in interface ObjectManagercls - The class of the interface or abstract class, or concrete class defined in MetaData
public boolean exists(java.lang.Object obj)
exists in interface ObjectManagerobj - The (persistable) object
public java.util.Set getManagedObjects()
getManagedObjects in interface ObjectManagerpublic java.util.Set getManagedObjects(java.lang.Class[] classes)
getManagedObjects in interface ObjectManagerclasses - Classes that we want the enlisted objects for
public java.util.Set getManagedObjects(java.lang.String[] states)
getManagedObjects in interface ObjectManagerstates - States that we want the enlisted objects for
public java.util.Set getManagedObjects(java.lang.String[] states,
java.lang.Class[] classes)
getManagedObjects in interface ObjectManagerstates - States that we want the enlisted objects forclasses - Classes that we want the enlisted objects for
public java.lang.Object findObjectUsingAID(java.lang.Class pcClass,
FieldValues fv,
boolean ignoreCache,
boolean checkInheritance)
findObjectUsingAID in interface ObjectManagerpcClass - The class of the PC objectfv - The field values to be loadedignoreCache - true if it must ignore the cachecheckInheritance - Whether look to the database to determine which
class this object is. This parameter is a hint. Set false, if it's
already determined the correct pcClass for this pc "object" in a certain
level in the hierarchy. Set to true and it will look to the database.
public java.lang.Object findObject(java.lang.Object id,
FieldValues fv,
java.lang.Class cls,
boolean ignoreCache)
findObject in interface ObjectManagerid - Id of the object.fv - Field values for the objectcls - the type which the object is. This type will be used to instanciat the objectignoreCache - true if it must ignore the cache
public java.lang.Object findObject(java.lang.Object id,
FieldValues fv)
findObject in interface ObjectManagerid - Id of the object.fv - Field values for the object
public java.lang.Object findObject(java.lang.Object id,
boolean validate,
boolean checkInheritance,
java.lang.String objectClassName)
findObject in interface ObjectManagerid - Id of the object.validate - Whether to validate the object statecheckInheritance - Whether look to the database to determine which
class this object is.objectClassName - Class name for the object with this id (if known, optional)
public java.lang.Object newObjectId(java.lang.Class pcClass,
java.lang.Object key)
newObjectId in interface ObjectManagerpcClass - Class of the PersistenceCapable to create the identity forkey - Value of the key for SingleFieldIdentity (or the toString value)
public java.lang.Object newObjectId(java.lang.String className,
java.lang.Object pc)
newObjectId in interface ObjectManagerclassName - Name of the class of the object.pc - The persistable object. Used for application-identity
public void clearDirty(StateManager sm)
clearDirty in interface ObjectManagersm - The StateManagerpublic void clearDirty()
clearDirty in interface ObjectManager
public void markDirty(StateManager sm,
boolean directUpdate)
markDirty in interface ObjectManagersm - The StateManagerdirectUpdate - Whether the object has had a direct update made on it (if known)public void markManagedRelationDirty(StateManager sm)
markManagedRelationDirty in interface ObjectManagersm - The StateManagerpublic boolean isManagingRelations()
isManagingRelations in interface ObjectManagerprotected void performManagedRelationships()
JPOXUserException - if a consistency check failspublic boolean isFlushing()
isFlushing in interface ObjectManagerpublic void flush()
flush in interface ObjectManagerpublic void flushInternal(boolean flushToDatastore)
flushInternal in interface ObjectManagerflushToDatastore - Whether to ensure any changes reach the datastore
Otherwise they will be flushed to the datastore manager and leave it to
decide the opportune moment to actually flush them to the datastore
JPOXOptimisticException - when optimistic locking error(s) occurpublic void postBegin()
postBegin in interface ObjectManagerpublic void preCommit()
preCommit in interface ObjectManagerpublic boolean isRunningDetachAllOnCommit()
isRunningDetachAllOnCommit in interface ObjectManagerpublic void postCommit()
postCommit in interface ObjectManagerpublic void preRollback()
preRollback in interface ObjectManager
public void replaceObjectId(java.lang.Object pc,
java.lang.Object oldID,
java.lang.Object newID)
replaceObjectId in interface ObjectManagerpc - The Persistable objectoldID - the old id it was known bynewID - the new id
public void putObjectIntoCache(StateManager sm,
boolean level1,
boolean level2)
putObjectIntoCache in interface ObjectManagersm - The State Managerlevel1 - Whether to put it in the L1 cachelevel2 - Whether to put it in the L2 cache
public void removeObjectFromCache(java.lang.Object pc,
java.lang.Object id,
boolean level1,
boolean level2)
removeObjectFromCache in interface ObjectManagerpc - The Persistpable objectid - The Persistable object idlevel1 - Whether to evict from the L1 cachelevel2 - Whether to evict from the L2 cachepublic java.lang.Object getObjectFromCache(java.lang.Object id)
getObjectFromCache in interface ObjectManagerid - Id of the object
public Extent getExtent(java.lang.Class pcClass,
boolean subclasses)
getExtent in interface ObjectManagerpcClass - The class to querysubclasses - Whether to include subclasses in the query.
public Query newQuery()
newQuery in interface ObjectManagerpublic void removeAllInstanceLifecycleListeners()
public CallbackHandler getCallbackHandler()
getCallbackHandler in interface ObjectManager
public void addListener(java.lang.Object listener,
java.lang.Class[] classes)
addListener in interface ObjectManagerlistener - The listener to sends events toclasses - The classes that it is interested inpublic void removeListener(java.lang.Object listener)
removeListener in interface ObjectManagerlistener - The listener to remove.public void disconnectLifecycleListener()
disconnectLifecycleListener in interface ObjectManagerprotected void assertIsOpen()
public void assertClassPersistable(java.lang.Class cls)
assertClassPersistable in interface ObjectManagercls - The class to check
ClassNotPersistableException - if class is not persistable
NoPersistenceInformationException - if no metadata/annotations are found for classprotected void assertDetachable(java.lang.Object object)
object - The object to checkprotected void assertNotDetached(java.lang.Object object)
object - The object to checkprotected void assertActiveTransaction()
protected void assertWritable()
a - TransactionNotActiveException if not active and non transactional write