public class ExecutionContextThreadedImpl extends ExecutionContextImpl
ExecutionContext.EmbeddedOwnerRelation, ExecutionContext.LifecycleListener
cache, l2CacheEnabled, lock, opAssociatedValuesMapByOP
OPTION_JTA_AUTOJOIN, OPTION_PASSWORD, OPTION_USERNAME
Constructor and Description |
---|
ExecutionContextThreadedImpl(PersistenceNucleusContext ctx,
Object owner,
Map<String,Object> options) |
Modifier and Type | Method and Description |
---|---|
void |
addObjectProvider(ObjectProvider op)
Method to add the object managed by the specified ObjectProvider to the (L1) cache.
|
void |
attachObject(ObjectProvider ownerOP,
Object pc,
boolean sco)
Method to attach a persistent detached object.
|
Object |
attachObjectCopy(ObjectProvider ownerOP,
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(ObjectProvider op)
Method to clear an object from the list of dirty objects.
|
void |
close()
Method to close the context.
|
void |
deleteObject(Object obj)
Method to delete an object from the datastore.
|
void |
deleteObjects(Object[] objs)
Method to delete an array of objects from the datastore.
|
void |
detachObject(Object obj,
FetchPlanState state)
Method to detach a persistent object without making a copy.
|
Object |
detachObjectCopy(Object pc,
FetchPlanState state)
Detach a copy of the passed persistent object using the provided detach state.
|
void |
enlistInTransaction(ObjectProvider sm)
Method to enlist the specified ObjectProvider in the current transaction.
|
void |
evictAllObjects()
Method to evict all current objects from L1 cache.
|
void |
evictFromTransaction(ObjectProvider sm)
Method to evict the specified ObjectProvider from the current transaction.
|
void |
evictObject(Object obj)
Internal method to evict an object from L1 cache.
|
ObjectProvider |
findObjectProvider(Object pc)
Method to find the ObjectProvider 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.
|
Extent |
getExtent(Class pcClass,
boolean subclasses)
Extents are collections of datastore objects managed by the datastore,
not by explicit user operations on collections.
|
boolean |
getMultithreaded()
Accessor for whether the object manager is multithreaded.
|
void |
hereIsObjectProvider(ObjectProvider sm,
Object pc)
Method to add the ObjectProvider for an object to this context's list.
|
void |
makeObjectTransactional(Object obj)
Method to make an object transactional.
|
void |
makeObjectTransient(Object obj,
FetchPlanState state)
Method to migrate an object to transient state.
|
void |
markDirty(ObjectProvider op,
boolean directUpdate)
Method to mark an object (ObjectProvider) as dirty.
|
Object |
persistObject(Object obj,
boolean merging)
Method to make an object persistent.
|
Object[] |
persistObjects(Object[] objs)
Method to persist an array of objects to the datastore.
|
void |
processNontransactionalUpdate()
Method called when a non-tx update has been performed (via setter call on the persistable object, or via
use of mutator methods of a field).
|
void |
refreshObject(Object obj)
Method to do a refresh of an object, updating it from its
datastore representation.
|
void |
removeObjectProvider(ObjectProvider op)
Method to remove the object managed by the specified ObjectProvider from the cache.
|
void |
replaceObjectId(Object pc,
Object oldID,
Object newID)
Replace the previous object id for a persistable object with a new one.
|
void |
retrieveObject(Object obj,
boolean fgOnly)
Method to retrieve an object.
|
acquireThreadContextInfo, addInternalFetchGroup, addOperationToQueue, assertActiveTransaction, assertClassPersistable, assertDetachable, assertHasImplementationCreator, assertIsOpen, assertNotDetached, closeCallbackHandler, containsObjectProviderAssociatedValue, deleteObjectInternal, deregisterEmbeddedRelation, deregisterExecutionContextListener, detachAll, evictObjects, exists, findObject, findObject, findObject, findObject, findObjectProvider, findObjectProviderForEmbedded, findObjectProviderOfOwnerForAttachingObject, findObjects, flushOperationsForBackingStore, getApiAdapter, getAttachDetachReferencedObject, getAttachedObjectForId, getBooleanProperty, getCallbackHandler, getClassLoaderResolver, getClassNameForObjectId, getEmbeddedInformationForOwner, getFetchGroupManager, getFetchGroupsWithName, getFetchPlan, getInternalFetchGroup, getIntProperty, getL2CacheableObject, getLevel1Cache, getLevel2CacheRetrieveMode, getLevel2CacheStoreMode, getLock, getLockManager, getManagedObjects, getManagedObjects, getManagedObjects, getManagedObjects, getManageRelations, getManageRelationsChecks, getMetaDataManager, getNucleusContext, getObjectFromCache, getObjectFromLevel1Cache, getObjectFromLevel2Cache, getObjectProviderAssociatedValue, getObjectsFromCache, getObjectsFromLevel2Cache, getObjectsToBeFlushed, getOperationQueue, getOwner, getOwnerInformationForEmbedded, getOwnersForEmbeddedObjectProvider, getProperties, getProperty, getReachabilityAtCommit, getRelationshipManager, getSerializeReadForClass, getStatistics, getStoreManager, getStringProperty, getSupportedProperties, getThreadContextInfo, getTransaction, getTypeManager, hasIdentityInCache, hasPersistenceInformationForClass, initialise, initialiseLevel1Cache, isClosed, isDelayDatastoreOperationsEnabled, isEnlistedInTransaction, isFlushing, isInserting, isManagingRelations, isObjectModifiedInTransaction, isRunningDetachAllOnCommit, makeObjectNontransactional, markFieldsForUpdateInLevel2Cache, newInstance, newObjectId, newObjectId, operationQueueIsActive, performManagedRelationships, persistObjectInternal, persistObjectInternal, persistObjectInternal, postBegin, postCommit, postRollback, preCommit, preRollback, processNontransactionalAtomicChanges, putObjectIntoLevel1Cache, putObjectIntoLevel2Cache, putObjectIntoLevel2CacheInternal, putObjectsIntoLevel2Cache, refreshAllObjects, registerEmbeddedRelation, registerExecutionContextListener, releaseThreadContextInfo, removeEmbeddedOwnerRelation, removeInternalFetchGroup, removeObjectFromLevel1Cache, removeObjectFromLevel2Cache, removeObjectProviderAssociatedValue, setAttachDetachReferencedObject, setLevel2Cache, setObjectProviderAssociatedValue, setProperties, setProperty, transactionCommitted, transactionEnded, transactionFlushed, transactionPreCommit, transactionPreFlush, transactionPreRollBack, transactionReleaseSavepoint, transactionRollbackToSavepoint, transactionRolledBack, transactionSetSavepoint, transactionStarted
public ExecutionContextThreadedImpl(PersistenceNucleusContext ctx, Object owner, Map<String,Object> options)
ctx
- NucleusContextowner
- Owner object (PM, EM)options
- Any options affecting startuppublic boolean getMultithreaded()
getMultithreaded
in interface ExecutionContext
getMultithreaded
in class ExecutionContextImpl
public void processNontransactionalUpdate()
ExecutionContextImpl
processNontransactionalUpdate
in interface ExecutionContext
processNontransactionalUpdate
in class ExecutionContextImpl
public void enlistInTransaction(ObjectProvider sm)
ExecutionContextImpl
enlistInTransaction
in interface ExecutionContext
enlistInTransaction
in class ExecutionContextImpl
sm
- The ObjectProviderpublic void evictFromTransaction(ObjectProvider sm)
ExecutionContextImpl
evictFromTransaction
in interface ExecutionContext
evictFromTransaction
in class ExecutionContextImpl
sm
- The ObjectProviderpublic void addObjectProvider(ObjectProvider op)
ExecutionContextImpl
addObjectProvider
in interface ExecutionContext
addObjectProvider
in class ExecutionContextImpl
op
- The ObjectProviderpublic void removeObjectProvider(ObjectProvider op)
ExecutionContextImpl
removeObjectProvider
in interface ExecutionContext
removeObjectProvider
in class ExecutionContextImpl
op
- The ObjectProviderpublic ObjectProvider findObjectProvider(Object pc)
ExecutionContextImpl
findObjectProvider
in interface ExecutionContext
findObjectProvider
in class ExecutionContextImpl
pc
- The object we are checkingpublic void hereIsObjectProvider(ObjectProvider sm, Object pc)
ExecutionContextImpl
hereIsObjectProvider
in interface ExecutionContext
hereIsObjectProvider
in class ExecutionContextImpl
sm
- The ObjectProviderpc
- The object managed by the ObjectProviderpublic void close()
ExecutionContextImpl
close
in interface ExecutionContext
close
in class ExecutionContextImpl
public void evictObject(Object obj)
ExecutionContextImpl
evictObject
in interface ExecutionContext
evictObject
in class ExecutionContextImpl
obj
- The objectpublic void refreshObject(Object obj)
ExecutionContextImpl
refreshObject
in interface ExecutionContext
refreshObject
in class ExecutionContextImpl
obj
- The Objectpublic void retrieveObject(Object obj, boolean fgOnly)
ExecutionContextImpl
retrieveObject
in interface ExecutionContext
retrieveObject
in class ExecutionContextImpl
obj
- The objectfgOnly
- Whether to retrieve the current fetch group fields onlypublic Object persistObject(Object obj, boolean merging)
ExecutionContextImpl
persistObject
in interface ExecutionContext
persistObject
in class ExecutionContextImpl
obj
- The objectmerging
- Whether this object (and dependents) is being mergedpublic Object[] persistObjects(Object[] objs)
ExecutionContextImpl
persistObjects
in interface ExecutionContext
persistObjects
in class ExecutionContextImpl
objs
- The objects to persistpublic void deleteObject(Object obj)
ExecutionContextImpl
deleteObject
in interface ExecutionContext
deleteObject
in class ExecutionContextImpl
obj
- The objectpublic void deleteObjects(Object[] objs)
ExecutionContextImpl
deleteObjects
in interface ExecutionContext
deleteObjects
in class ExecutionContextImpl
objs
- The objectspublic void makeObjectTransient(Object obj, FetchPlanState state)
ExecutionContextImpl
makeObjectTransient
in interface ExecutionContext
makeObjectTransient
in class ExecutionContextImpl
obj
- The objectstate
- Object containing the state of the fetch plan process (if any)public void makeObjectTransactional(Object obj)
ExecutionContextImpl
makeObjectTransactional
in interface ExecutionContext
makeObjectTransactional
in class ExecutionContextImpl
obj
- The objectpublic void attachObject(ObjectProvider ownerOP, Object pc, boolean sco)
ExecutionContextImpl
attachObject
in interface ExecutionContext
attachObject
in class ExecutionContextImpl
ownerOP
- ObjectProvider of the owner object that has this in a field that causes this attachpc
- The persistable objectsco
- Whether the PC object is stored without an identity (embedded/serialised)public Object attachObjectCopy(ObjectProvider ownerOP, Object pc, boolean sco)
ExecutionContextImpl
attachObjectCopy
in interface ExecutionContext
attachObjectCopy
in class ExecutionContextImpl
ownerOP
- ObjectProvider of the owner object that has this in a field that causes this attachpc
- The objectsco
- Whether it has no identity (second-class object)public void detachObject(Object obj, FetchPlanState state)
ExecutionContextImpl
detachObject
in interface ExecutionContext
detachObject
in class ExecutionContextImpl
obj
- The objectstate
- State for the detachment processpublic Object detachObjectCopy(Object pc, FetchPlanState state)
ExecutionContextImpl
detachObjectCopy
in interface ExecutionContext
detachObjectCopy
in class ExecutionContextImpl
pc
- The objectstate
- State for the detachment processpublic void clearDirty(ObjectProvider op)
ExecutionContextImpl
clearDirty
in interface ExecutionContext
clearDirty
in class ExecutionContextImpl
op
- The ObjectProviderpublic void clearDirty()
ExecutionContextImpl
clearDirty
in interface ExecutionContext
clearDirty
in class ExecutionContextImpl
public void evictAllObjects()
evictAllObjects
in interface ExecutionContext
evictAllObjects
in class ExecutionContextImpl
public void markDirty(ObjectProvider op, boolean directUpdate)
ExecutionContextImpl
markDirty
in interface ExecutionContext
markDirty
in class ExecutionContextImpl
op
- ObjectProviderdirectUpdate
- Whether the object has had a direct update made on it (if known)public void flush()
ExecutionContextImpl
flush
in interface ExecutionContext
flush
in class ExecutionContextImpl
public void flushInternal(boolean flushToDatastore)
ExecutionContextImpl
flushInternal
in interface ExecutionContext
flushInternal
in class ExecutionContextImpl
flushToDatastore
- 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 datastorepublic void replaceObjectId(Object pc, Object oldID, Object newID)
ExecutionContextImpl
replaceObjectId
in interface ExecutionContext
replaceObjectId
in class ExecutionContextImpl
pc
- The Persistable objectoldID
- the old id it was known bynewID
- the new idpublic Extent getExtent(Class pcClass, boolean subclasses)
ExecutionContextImpl
getExtent
in interface ExecutionContext
getExtent
in class ExecutionContextImpl
pcClass
- The class to querysubclasses
- Whether to include subclasses in the query.Copyright © 2017. All rights reserved.