org.datanucleus
Class ExecutionContextImpl

java.lang.Object
  extended by org.datanucleus.ExecutionContextImpl
All Implemented Interfaces:
ExecutionContext

public class ExecutionContextImpl
extends java.lang.Object
implements ExecutionContext

Context of execution for persistence operations


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.datanucleus.store.ExecutionContext
ExecutionContext.LifecycleListener
 
Constructor Summary
ExecutionContextImpl(ObjectManager om)
           
 
Method Summary
 void attachObject(java.lang.Object pc, boolean sco)
           
 java.lang.Object attachObjectCopy(java.lang.Object pc, boolean sco)
           
 void deleteObject(java.lang.Object obj)
           
 void deleteObjectInternal(java.lang.Object pc)
           
 void deleteObjects(java.lang.Object[] objs)
           
 void detachObject(java.lang.Object val, FetchPlanState state)
           
 java.lang.Object detachObjectCopy(java.lang.Object pc, FetchPlanState state)
           
 void evictFromTransaction(ObjectProvider sm)
           
 java.lang.Object findObject(java.lang.Object id, boolean validate, boolean checkInheritance, java.lang.String objectClassName)
           
 java.lang.Object findObject(java.lang.Object id, FieldValues2 fv, java.lang.Class pcClass, boolean ignoreCache)
           
 ObjectProvider findObjectProvider(java.lang.Object obj)
           
 ObjectProvider findObjectProvider(java.lang.Object object, boolean persist)
           
 ObjectProvider findObjectProviderForEmbedded(java.lang.Object value, ObjectProvider owner, AbstractMemberMetaData mmd)
           
 java.lang.Object findObjectUsingAID(Type pcClass, FieldValues2 fv, boolean ignoreCache, boolean checkInheritance)
           
 void flushInternal(boolean flushToDatastore)
           
 ApiAdapter getApiAdapter()
           
 java.lang.Object getAttachedObjectForId(java.lang.Object id)
           
 ClassLoaderResolver getClassLoaderResolver()
          Accessor for the ClassLoader resolver to use in class loading issues.
 java.lang.Integer getDatastoreReadTimeoutMillis()
           
 java.lang.Integer getDatastoreWriteTimeoutMillis()
           
 Extent getExtent(java.lang.Class candidateClass, boolean includeSubclasses)
           
 FetchPlan getFetchPlan()
           
 boolean getIgnoreCache()
           
 LockManager getLockManager()
          Accessor for the LockManager.
 MetaDataManager getMetaDataManager()
          Accessor for the MetaData Manager.
 java.lang.Object getObjectFromCache(java.lang.Object id)
           
 ObjectManager getObjectManager()
           
 ObjectManagerFactoryImpl getObjectManagerFactory()
           
 OMFContext getOMFContext()
           
 boolean getSerializeReadForClass(java.lang.String className)
           
 StoreManager getStoreManager()
           
 Transaction getTransaction()
          Accessor for the current transaction for this ExecutionContext.
 TypeManager getTypeManager()
          TODO should we keep this here? this is api/language dependent
 boolean hasIdentityInCache(java.lang.Object id)
          Whether an object with the specified identity exists in the cache(s).
 void hasPersistenceInformationForClass(java.lang.Class cls)
           
 boolean isClosed()
           
 boolean isDelayDatastoreOperationsEnabled()
           
 boolean isFlushing()
           
 boolean isInserting(java.lang.Object pc)
           
 void makeObjectTransient(java.lang.Object pc, FetchPlanState state)
           
 void markDirty(ObjectProvider sm, boolean directUpdate)
           
 java.lang.Object newObjectId(java.lang.Class pcClass, java.lang.Object key)
           
 java.lang.Object newObjectId(java.lang.String className, java.lang.Object pc)
           
 ObjectProvider newObjectProvider(java.lang.Object id, java.lang.Object obj)
           
 ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd)
           
 ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd, AbstractClassMetaData effectiveTypeCmd)
           
 ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd, Type effectiveType)
           
 Query newQuery()
           
 void persistObjectInternal(java.lang.Object pc, FieldValues2 preInsertChanges, int objectType)
           
 java.lang.Object persistObjectInternal(java.lang.Object pc, ObjectProvider ownerSM, int ownerFieldNum, int objectType)
          Method to persist the passed object (internally).
 void refreshObject(java.lang.Object pc)
           
 void removeObjectFromCache(java.lang.Object pc, java.lang.Object id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionContextImpl

public ExecutionContextImpl(ObjectManager om)
Method Detail

getObjectManager

public ObjectManager getObjectManager()

getLockManager

public LockManager getLockManager()
Description copied from interface: ExecutionContext
Accessor for the LockManager.

Specified by:
getLockManager in interface ExecutionContext
Returns:
The Lock Manager

findObjectUsingAID

public java.lang.Object findObjectUsingAID(Type pcClass,
                                           FieldValues2 fv,
                                           boolean ignoreCache,
                                           boolean checkInheritance)
Specified by:
findObjectUsingAID in interface ExecutionContext

getClassLoaderResolver

public ClassLoaderResolver getClassLoaderResolver()
Description copied from interface: ExecutionContext
Accessor for the ClassLoader resolver to use in class loading issues.

Specified by:
getClassLoaderResolver in interface ExecutionContext
Returns:
The ClassLoader resolver

getMetaDataManager

public MetaDataManager getMetaDataManager()
Description copied from interface: ExecutionContext
Accessor for the MetaData Manager.

Specified by:
getMetaDataManager in interface ExecutionContext
Returns:
The MetaData Manager

getTransaction

public Transaction getTransaction()
Description copied from interface: ExecutionContext
Accessor for the current transaction for this ExecutionContext.

Specified by:
getTransaction in interface ExecutionContext
Returns:
The current transaction

getTypeManager

public TypeManager getTypeManager()
Description copied from interface: ExecutionContext
TODO should we keep this here? this is api/language dependent

Specified by:
getTypeManager in interface ExecutionContext
Returns:
The type manager

findObjectProvider

public ObjectProvider findObjectProvider(java.lang.Object object,
                                         boolean persist)
Specified by:
findObjectProvider in interface ExecutionContext
Parameters:
persist - persists the object if not yet persisted.

getApiAdapter

public ApiAdapter getApiAdapter()
Specified by:
getApiAdapter in interface ExecutionContext

findObjectProviderForEmbedded

public ObjectProvider findObjectProviderForEmbedded(java.lang.Object value,
                                                    ObjectProvider owner,
                                                    AbstractMemberMetaData mmd)
Specified by:
findObjectProviderForEmbedded in interface ExecutionContext

newObjectProvider

public ObjectProvider newObjectProvider(java.lang.Object id,
                                        java.lang.Object obj)
Specified by:
newObjectProvider in interface ExecutionContext

newObjectProviderForMember

public ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd)
Specified by:
newObjectProviderForMember in interface ExecutionContext

newObjectProviderForMember

public ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd,
                                                 Type effectiveType)
Specified by:
newObjectProviderForMember in interface ExecutionContext

newObjectProviderForMember

public ObjectProvider newObjectProviderForMember(AbstractMemberMetaData mmd,
                                                 AbstractClassMetaData effectiveTypeCmd)
Specified by:
newObjectProviderForMember in interface ExecutionContext

deleteObjectInternal

public void deleteObjectInternal(java.lang.Object pc)
Specified by:
deleteObjectInternal in interface ExecutionContext

persistObjectInternal

public java.lang.Object persistObjectInternal(java.lang.Object pc,
                                              ObjectProvider ownerSM,
                                              int ownerFieldNum,
                                              int objectType)
Method to persist the passed object (internally).

Specified by:
persistObjectInternal in interface ExecutionContext
Parameters:
pc - The object
ownerSM - StateManager of the owner when embedded
ownerFieldNum - Field number in the owner where this is embedded (or -1 if not embedded)
objectType - Type of object (see org.datanucleus.StateManager, e.g StateManager.PC)
Returns:
The persisted object

isClosed

public boolean isClosed()
Specified by:
isClosed in interface ExecutionContext

getFetchPlan

public FetchPlan getFetchPlan()
Specified by:
getFetchPlan in interface ExecutionContext

newQuery

public Query newQuery()
Specified by:
newQuery in interface ExecutionContext

getOMFContext

public OMFContext getOMFContext()
Specified by:
getOMFContext in interface ExecutionContext

getStoreManager

public StoreManager getStoreManager()
Specified by:
getStoreManager in interface ExecutionContext

findObjectProvider

public ObjectProvider findObjectProvider(java.lang.Object obj)
Specified by:
findObjectProvider in interface ExecutionContext

findObject

public java.lang.Object findObject(java.lang.Object id,
                                   boolean validate,
                                   boolean checkInheritance,
                                   java.lang.String objectClassName)
Specified by:
findObject in interface ExecutionContext

flushInternal

public void flushInternal(boolean flushToDatastore)
Specified by:
flushInternal in interface ExecutionContext

detachObject

public void detachObject(java.lang.Object val,
                         FetchPlanState state)
Specified by:
detachObject in interface ExecutionContext

deleteObjects

public void deleteObjects(java.lang.Object[] objs)
Specified by:
deleteObjects in interface ExecutionContext

attachObjectCopy

public java.lang.Object attachObjectCopy(java.lang.Object pc,
                                         boolean sco)
Specified by:
attachObjectCopy in interface ExecutionContext

detachObjectCopy

public java.lang.Object detachObjectCopy(java.lang.Object pc,
                                         FetchPlanState state)
Specified by:
detachObjectCopy in interface ExecutionContext

refreshObject

public void refreshObject(java.lang.Object pc)
Specified by:
refreshObject in interface ExecutionContext

evictFromTransaction

public void evictFromTransaction(ObjectProvider sm)
Specified by:
evictFromTransaction in interface ExecutionContext

isFlushing

public boolean isFlushing()
Specified by:
isFlushing in interface ExecutionContext

getIgnoreCache

public boolean getIgnoreCache()
Specified by:
getIgnoreCache in interface ExecutionContext

getDatastoreReadTimeoutMillis

public java.lang.Integer getDatastoreReadTimeoutMillis()
Specified by:
getDatastoreReadTimeoutMillis in interface ExecutionContext

getDatastoreWriteTimeoutMillis

public java.lang.Integer getDatastoreWriteTimeoutMillis()
Specified by:
getDatastoreWriteTimeoutMillis in interface ExecutionContext

isDelayDatastoreOperationsEnabled

public boolean isDelayDatastoreOperationsEnabled()
Specified by:
isDelayDatastoreOperationsEnabled in interface ExecutionContext

markDirty

public void markDirty(ObjectProvider sm,
                      boolean directUpdate)
Specified by:
markDirty in interface ExecutionContext

getExtent

public Extent getExtent(java.lang.Class candidateClass,
                        boolean includeSubclasses)
Specified by:
getExtent in interface ExecutionContext

attachObject

public void attachObject(java.lang.Object pc,
                         boolean sco)
Specified by:
attachObject in interface ExecutionContext

getObjectFromCache

public java.lang.Object getObjectFromCache(java.lang.Object id)
Specified by:
getObjectFromCache in interface ExecutionContext

removeObjectFromCache

public void removeObjectFromCache(java.lang.Object pc,
                                  java.lang.Object id)
Specified by:
removeObjectFromCache in interface ExecutionContext

hasIdentityInCache

public boolean hasIdentityInCache(java.lang.Object id)
Whether an object with the specified identity exists in the cache(s). Used as a check on identity (inheritance-level) validity

Specified by:
hasIdentityInCache in interface ExecutionContext
Parameters:
id - The identity
Returns:
Whether it exists

findObject

public java.lang.Object findObject(java.lang.Object id,
                                   FieldValues2 fv,
                                   java.lang.Class pcClass,
                                   boolean ignoreCache)
Specified by:
findObject in interface ExecutionContext

getSerializeReadForClass

public boolean getSerializeReadForClass(java.lang.String className)
Specified by:
getSerializeReadForClass in interface ExecutionContext

hasPersistenceInformationForClass

public void hasPersistenceInformationForClass(java.lang.Class cls)
Specified by:
hasPersistenceInformationForClass in interface ExecutionContext

makeObjectTransient

public void makeObjectTransient(java.lang.Object pc,
                                FetchPlanState state)
Specified by:
makeObjectTransient in interface ExecutionContext

isInserting

public boolean isInserting(java.lang.Object pc)
Specified by:
isInserting in interface ExecutionContext

getAttachedObjectForId

public java.lang.Object getAttachedObjectForId(java.lang.Object id)
Specified by:
getAttachedObjectForId in interface ExecutionContext

getObjectManagerFactory

public ObjectManagerFactoryImpl getObjectManagerFactory()
Specified by:
getObjectManagerFactory in interface ExecutionContext

persistObjectInternal

public void persistObjectInternal(java.lang.Object pc,
                                  FieldValues2 preInsertChanges,
                                  int objectType)
Specified by:
persistObjectInternal in interface ExecutionContext

newObjectId

public java.lang.Object newObjectId(java.lang.String className,
                                    java.lang.Object pc)
Specified by:
newObjectId in interface ExecutionContext

newObjectId

public java.lang.Object newObjectId(java.lang.Class pcClass,
                                    java.lang.Object key)
Specified by:
newObjectId in interface ExecutionContext

deleteObject

public void deleteObject(java.lang.Object obj)
Specified by:
deleteObject in interface ExecutionContext


Copyright © 2011. All Rights Reserved.