public class ObjectProviderFactoryImpl extends Object implements ObjectProviderFactory
Modifier and Type | Field and Description |
---|---|
static Class[] |
OBJECT_PROVIDER_CTR_ARG_CLASSES |
Constructor and Description |
---|
ObjectProviderFactoryImpl(PersistenceNucleusContext nucCtx) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
disconnectObjectProvider(ObjectProvider op)
Hook to allow an ObjectProvider to mark itself as disconnected so that it is returned to the pool.
|
protected ObjectProvider |
getObjectProvider(ExecutionContext ec,
AbstractClassMetaData cmd) |
<T> ObjectProvider<T> |
newForCachedPC(ExecutionContext ec,
Object id,
CachedPC<T> cachedPC)
Constructor to create an ObjectProvider for an object taken from the L2 cache with the specified id.
|
<T> ObjectProvider<T> |
newForDetached(ExecutionContext ec,
T pc,
Object id,
Object version)
Constructor for creating an ObjectProvider to manage a persistable object in detached state.
|
ObjectProvider |
newForEmbedded(ExecutionContext ec,
AbstractClassMetaData cmd,
ObjectProvider ownerOP,
int ownerFieldNumber)
Constructs an ObjectProvider for an object of the specified type, creating the PC object to hold the values
where this object will be EMBEDDED/SERIALISED into another persistable object.
|
<T> ObjectProvider<T> |
newForEmbedded(ExecutionContext ec,
T pc,
boolean copyPc,
ObjectProvider ownerOP,
int ownerFieldNumber)
Constructs an ObjectProvider to manage a persistable instance that will
be EMBEDDED/SERIALISED into another persistable object.
|
<T> ObjectProvider<T> |
newForHollow(ExecutionContext ec,
Class<T> pcClass,
Object id)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
<T> ObjectProvider<T> |
newForHollow(ExecutionContext ec,
Class<T> pcClass,
Object id,
FieldValues fv)
Constructs an ObjectProvider to manage a recently populated hollow instance having the
given object ID and the given field values.
|
<T> ObjectProvider<T> |
newForHollowPopulatedAppId(ExecutionContext ec,
Class<T> pcClass,
FieldValues fv)
Deprecated.
Use newForHollowPopulated instead
|
<T> ObjectProvider<T> |
newForHollowPreConstructed(ExecutionContext ec,
Object id,
T pc)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
<T> ObjectProvider<T> |
newForPersistentClean(ExecutionContext ec,
Object id,
T pc)
Constructs an ObjectProvider to manage the specified persistent instance having the given object ID.
|
<T> ObjectProvider<T> |
newForPersistentNew(ExecutionContext ec,
T pc,
FieldValues preInsertChanges)
Constructs an ObjectProvider to manage a transient instance that is becoming newly persistent.
|
<T> ObjectProvider<T> |
newForPNewToBeDeleted(ExecutionContext ec,
T pc)
Constructor for creating an ObjectProvider to manage a persistable object that is not persistent yet
is about to be deleted.
|
<T> ObjectProvider<T> |
newForTransactionalTransient(ExecutionContext ec,
T pc)
Constructs an ObjectProvider to manage a transactional-transient instance.
|
public static final Class[] OBJECT_PROVIDER_CTR_ARG_CLASSES
public ObjectProviderFactoryImpl(PersistenceNucleusContext nucCtx)
public void close()
close
in interface ObjectProviderFactory
public <T> ObjectProvider<T> newForHollow(ExecutionContext ec, Class<T> pcClass, Object id)
newForHollow
in interface ObjectProviderFactory
T
- Type of the persistable classec
- the ExecutionContextpcClass
- the class of the new instance to be created.id
- the identity of the object.public <T> ObjectProvider<T> newForHollow(ExecutionContext ec, Class<T> pcClass, Object id, FieldValues fv)
newForHollow
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpcClass
- the class of the new instance to be created.id
- the identity of the object.fv
- the initial field values of the object.public <T> ObjectProvider<T> newForHollowPreConstructed(ExecutionContext ec, Object id, T pc)
newForHollowPreConstructed
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextid
- the identity of the object.pc
- The object that is hollow that we are going to managepublic <T> ObjectProvider<T> newForHollowPopulatedAppId(ExecutionContext ec, Class<T> pcClass, FieldValues fv)
newForHollowPopulatedAppId
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpcClass
- the class of the new instance to be created.fv
- the initial field values of the object.public <T> ObjectProvider<T> newForPersistentClean(ExecutionContext ec, Object id, T pc)
newForPersistentClean
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextid
- the identity of the object.pc
- The object that is persistent that we are going to managepublic <T> ObjectProvider<T> newForEmbedded(ExecutionContext ec, T pc, boolean copyPc, ObjectProvider ownerOP, int ownerFieldNumber)
newForEmbedded
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpc
- The persistable to manage (see copyPc also)copyPc
- Whether the SM should manage a copy of the passed PC or that oneownerOP
- Owner ObjectProviderownerFieldNumber
- Field number in owner object where this is storedpublic ObjectProvider newForEmbedded(ExecutionContext ec, AbstractClassMetaData cmd, ObjectProvider ownerOP, int ownerFieldNumber)
newForEmbedded
in interface ObjectProviderFactory
ec
- ExecutionContextcmd
- Meta-data for the class that this is an instance of.ownerOP
- Owner ObjectProviderownerFieldNumber
- Field number in owner object where this is storedpublic <T> ObjectProvider<T> newForPersistentNew(ExecutionContext ec, T pc, FieldValues preInsertChanges)
newForPersistentNew
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpc
- the instance being make persistent.preInsertChanges
- Any changes to make before insertingpublic <T> ObjectProvider<T> newForTransactionalTransient(ExecutionContext ec, T pc)
newForTransactionalTransient
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpc
- the instance being make persistent.public <T> ObjectProvider<T> newForDetached(ExecutionContext ec, T pc, Object id, Object version)
newForDetached
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextpc
- the detached objectid
- the identity of the object.version
- the detached versionpublic <T> ObjectProvider<T> newForPNewToBeDeleted(ExecutionContext ec, T pc)
newForPNewToBeDeleted
in interface ObjectProviderFactory
T
- Type of the persistable classec
- Execution Contextpc
- the object being deleted from persistencepublic <T> ObjectProvider<T> newForCachedPC(ExecutionContext ec, Object id, CachedPC<T> cachedPC)
newForCachedPC
in interface ObjectProviderFactory
T
- Type of the persistable classec
- ExecutionContextid
- Id to assign to the persistable objectcachedPC
- CachedPC object from the L2 cachepublic void disconnectObjectProvider(ObjectProvider op)
disconnectObjectProvider
in interface ObjectProviderFactory
op
- The ObjectProvider to re-poolprotected ObjectProvider getObjectProvider(ExecutionContext ec, AbstractClassMetaData cmd)
Copyright © 2019. All rights reserved.