public class ObjectProviderFactoryImpl extends Object implements ObjectProviderFactory
Modifier and Type | Field and Description |
---|---|
protected static Localiser |
LOCALISER
Localiser for messages.
|
static Class[] |
OBJECT_PROVIDER_CTR_ARG_CLASSES |
Constructor and Description |
---|
ObjectProviderFactoryImpl(NucleusContext nucCtx)
Single pool of all ObjectProvider objects.
|
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) |
ObjectProvider |
newForCachedPC(ExecutionContext ec,
Object id,
CachedPC cachedPC)
Constructor to create an ObjectProvider for an object taken from the L2 cache with the specified id.
|
ObjectProvider |
newForDetached(ExecutionContext ec,
Object 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.
|
ObjectProvider |
newForEmbedded(ExecutionContext ec,
Object pc,
boolean copyPc,
ObjectProvider ownerOP,
int ownerFieldNumber)
Constructs an ObjectProvider to manage a persistable instance that will
be EMBEDDED/SERIALISED into another persistable object.
|
ObjectProvider |
newForHollow(ExecutionContext ec,
Class pcClass,
Object id)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
ObjectProvider |
newForHollow(ExecutionContext ec,
Class 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.
|
ObjectProvider |
newForHollowPopulatedAppId(ExecutionContext ec,
Class pcClass,
FieldValues fv)
Deprecated.
Use newForHollowPopulated instead
|
ObjectProvider |
newForHollowPreConstructed(ExecutionContext ec,
Object id,
Object pc)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
ObjectProvider |
newForPersistentClean(ExecutionContext ec,
Object id,
Object pc)
Constructs an ObjectProvider to manage the specified persistent instance having the given object ID.
|
ObjectProvider |
newForPersistentNew(ExecutionContext ec,
Object pc,
FieldValues preInsertChanges)
Constructs an ObjectProvider to manage a transient instance that is becoming newly persistent.
|
ObjectProvider |
newForPNewToBeDeleted(ExecutionContext ec,
Object pc)
Constructor for creating an ObjectProvider to manage a persistable object that is not persistent yet
is about to be deleted.
|
ObjectProvider |
newForTransactionalTransient(ExecutionContext ec,
Object pc)
Constructs an ObjectProvider to manage a transactional-transient instance.
|
protected static final Localiser LOCALISER
public static Class[] OBJECT_PROVIDER_CTR_ARG_CLASSES
public ObjectProviderFactoryImpl(NucleusContext nucCtx)
public void close()
close
in interface ObjectProviderFactory
public ObjectProvider newForHollow(ExecutionContext ec, Class pcClass, Object id)
newForHollow
in interface ObjectProviderFactory
ec
- the ExecutionContextpcClass
- the class of the new instance to be created.id
- the identity of the object.public ObjectProvider newForHollow(ExecutionContext ec, Class pcClass, Object id, FieldValues fv)
newForHollow
in interface ObjectProviderFactory
ec
- 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 ObjectProvider newForHollowPreConstructed(ExecutionContext ec, Object id, Object pc)
newForHollowPreConstructed
in interface ObjectProviderFactory
ec
- ExecutionContextid
- the identity of the object.pc
- The object that is hollow that we are going to managepublic ObjectProvider newForHollowPopulatedAppId(ExecutionContext ec, Class pcClass, FieldValues fv)
newForHollowPopulatedAppId
in interface ObjectProviderFactory
ec
- ExecutionContextpcClass
- the class of the new instance to be created.fv
- the initial field values of the object.public ObjectProvider newForPersistentClean(ExecutionContext ec, Object id, Object pc)
newForPersistentClean
in interface ObjectProviderFactory
ec
- ExecutionContextid
- the identity of the object.pc
- The object that is persistent that we are going to managepublic ObjectProvider newForEmbedded(ExecutionContext ec, Object pc, boolean copyPc, ObjectProvider ownerOP, int ownerFieldNumber)
newForEmbedded
in interface ObjectProviderFactory
ec
- 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 ObjectProvider newForPersistentNew(ExecutionContext ec, Object pc, FieldValues preInsertChanges)
newForPersistentNew
in interface ObjectProviderFactory
ec
- ExecutionContextpc
- the instance being make persistent.preInsertChanges
- Any changes to make before insertingpublic ObjectProvider newForTransactionalTransient(ExecutionContext ec, Object pc)
newForTransactionalTransient
in interface ObjectProviderFactory
ec
- ExecutionContextpc
- the instance being make persistent.public ObjectProvider newForDetached(ExecutionContext ec, Object pc, Object id, Object version)
newForDetached
in interface ObjectProviderFactory
ec
- ExecutionContextpc
- the detached objectid
- the identity of the object.version
- the detached versionpublic ObjectProvider newForPNewToBeDeleted(ExecutionContext ec, Object pc)
newForPNewToBeDeleted
in interface ObjectProviderFactory
ec
- Execution Contextpc
- the object being deleted from persistencepublic ObjectProvider newForCachedPC(ExecutionContext ec, Object id, CachedPC cachedPC)
newForCachedPC
in interface ObjectProviderFactory
ec
- 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 © 2021. All rights reserved.