public class ProxyIndirectionPolicy extends BasicIndirectionPolicy
Proxy Indirection uses the Proxy and InvocationHandler features
of JDK 1.3 to provide "transparent indirection" for 1:1 relationships. In order to use Proxy
Indirection:
toString is called on the proxy the real object data is retrieved from the database.ProxyIndirectionHandler,
Serialized Form| Constructor and Description |
|---|
ProxyIndirectionPolicy() |
ProxyIndirectionPolicy(java.lang.Class[] targetInterfaces) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
backupCloneAttribute(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Return a backup clone of the attribute.
|
java.lang.Object |
cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
CacheKey cacheKey,
java.lang.Object clone,
java.lang.Integer refreshCascade,
AbstractSession cloningSession,
boolean buildDirectlyFromRow)
INTERNAL:
Return a clone of the attribute.
|
AbstractRecord |
extractReferenceRow(java.lang.Object referenceObject)
INTERNAL:
Return the reference row for the reference object.
|
void |
fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
DistributedSession session)
INTERNAL:
An object has been serialized from the server to the client.
|
java.lang.Object |
getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
INTERNAL:
Return the original indirection object for a unit of work indirection object.
|
java.lang.Object |
getRealAttributeValueFromObject(java.lang.Object obj,
java.lang.Object object)
INTERNAL:
Return the "real" attribute value, as opposed to any wrapper.
|
static java.lang.Object |
getValueFromProxy(java.lang.Object value)
INTERNAL:
Given a proxy object, trigger the indirection and return the actual object represented by the proxy.
|
boolean |
hasTargetInterfaces()
INTERNAL:
Return if targetInterfaces is not empty.
|
void |
initialize()
INTERNAL:
Nothing required.
|
boolean |
isAttributeValueFullyBuilt(java.lang.Object attributeValue)
INTERNAL:
The method validateAttributeOfInstantiatedObject(Object attributeValue) fixes the value of the attributeValue
in cases where it is null and indirection requires that it contain some specific data structure.
|
boolean |
isValidType(java.lang.Class attributeType)
INTERNAL:
Verify that a class type is valid to use for the proxy.
|
void |
iterateOnAttributeValue(DescriptorIterator iterator,
java.lang.Object attributeValue)
INTERNAL:
Iterate over the specified attribute value.
|
void |
mergeRemoteValueHolder(java.lang.Object clientSideDomainObject,
java.lang.Object serverSideDomainObject,
MergeManager mergeManager)
INTERNAL:
Replace the client value holder with the server value holder after copying some of the settings from
the client value holder.
|
java.lang.Object |
nullValueFromRow()
INTERNAL:
Return the null value of the appropriate attribute.
|
boolean |
objectIsEasilyInstantiated(java.lang.Object object)
INTERNAL:
Return whether the specified object can be instantiated without database access.
|
boolean |
objectIsInstantiated(java.lang.Object object)
INTERNAL:
Return whether the specified object is instantiated.
|
void |
reset(java.lang.Object target)
Reset the wrapper used to store the value.
|
void |
setRealAttributeValueInObject(java.lang.Object target,
java.lang.Object attributeValue)
INTERNAL:
Set the "real" value of the attribute to attributeValue.
|
java.lang.Object |
validateAttributeOfInstantiatedObject(java.lang.Object attributeValue)
INTERNAL:
Verify that the value of the attribute within an instantiated object is of the appropriate type for
the indirection policy.
|
void |
validateDeclaredAttributeType(java.lang.Class attributeType,
IntegrityChecker checker)
INTERNAL:
Verify that attribute type is correct for the indirection policy.
|
void |
validateGetMethodReturnType(java.lang.Class returnType,
IntegrityChecker checker)
INTERNAL:
Verify that the return type of the attribute's get method is correct for the indirection policy.
|
void |
validateSetMethodParameterType(java.lang.Class parameterType,
IntegrityChecker checker)
INTERNAL:
Verify that the parameter type of the attribute's set method is correct for the indirection policy.
|
java.lang.Object |
valueFromBatchQuery(ReadQuery batchQuery,
AbstractRecord row,
ObjectLevelReadQuery originalQuery,
CacheKey parentCacheKey)
INTERNAL:
Return the value to be stored in the object's attribute.
|
java.lang.Object |
valueFromMethod(java.lang.Object object,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
java.lang.Object |
valueFromQuery(ReadQuery query,
AbstractRecord row,
AbstractSession session)
INTERNAL:
Return the value to be stored in the object's attribute.
|
java.lang.Object |
valueFromRow(java.lang.Object object)
INTERNAL:
Return the value to be stored in the object's attribute.
|
buildIndirectObject, extractPrimaryKeyForReferenceObject, getOriginalIndirectionObjectForMerge, getOriginalValueHolder, getValueFromRemoteValueHolder, setSourceObject, valueFromQueryclone, getMapping, instantiateObject, isWeavedObjectBasicIndirectionPolicy, objectIsInstantiatedOrChanged, setMapping, setRealAttributeValueInObject, setUseLazyInstantiation, shouldUseLazyInstantiation, usesIndirection, usesTransparentIndirection, validateContainerPolicy, validateDeclaredAttributeTypeForCollection, validateGetMethodReturnTypeForCollection, validateSetMethodParameterTypeForCollectionpublic ProxyIndirectionPolicy(java.lang.Class[] targetInterfaces)
public ProxyIndirectionPolicy()
public void initialize()
initialize in class IndirectionPolicypublic void reset(java.lang.Object target)
reset in class BasicIndirectionPolicypublic boolean hasTargetInterfaces()
public java.lang.Object valueFromRow(java.lang.Object object)
valueFromRow in class BasicIndirectionPolicypublic java.lang.Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session)
valueFromQuery in class BasicIndirectionPolicypublic java.lang.Object valueFromMethod(java.lang.Object object,
AbstractRecord row,
AbstractSession session)
valueFromMethod in class BasicIndirectionPolicypublic java.lang.Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey)
valueFromBatchQuery in class BasicIndirectionPolicypublic boolean objectIsInstantiated(java.lang.Object object)
objectIsInstantiated in class BasicIndirectionPolicypublic boolean objectIsEasilyInstantiated(java.lang.Object object)
objectIsEasilyInstantiated in class BasicIndirectionPolicypublic java.lang.Object nullValueFromRow()
nullValueFromRow in class BasicIndirectionPolicypublic void mergeRemoteValueHolder(java.lang.Object clientSideDomainObject,
java.lang.Object serverSideDomainObject,
MergeManager mergeManager)
mergeRemoteValueHolder in class BasicIndirectionPolicypublic java.lang.Object getRealAttributeValueFromObject(java.lang.Object obj,
java.lang.Object object)
getRealAttributeValueFromObject in class BasicIndirectionPolicypublic static java.lang.Object getValueFromProxy(java.lang.Object value)
public void setRealAttributeValueInObject(java.lang.Object target,
java.lang.Object attributeValue)
setRealAttributeValueInObject in class BasicIndirectionPolicypublic java.lang.Object getOriginalIndirectionObject(java.lang.Object unitOfWorkIndirectionObject,
AbstractSession session)
getOriginalIndirectionObject in class BasicIndirectionPolicypublic void fixObjectReferences(java.lang.Object object,
java.util.Map objectDescriptors,
java.util.Map processedObjects,
ObjectLevelReadQuery query,
DistributedSession session)
fixObjectReferences in class BasicIndirectionPolicypublic AbstractRecord extractReferenceRow(java.lang.Object referenceObject)
extractReferenceRow in class BasicIndirectionPolicypublic java.lang.Object cloneAttribute(java.lang.Object attributeValue,
java.lang.Object original,
CacheKey cacheKey,
java.lang.Object clone,
java.lang.Integer refreshCascade,
AbstractSession cloningSession,
boolean buildDirectlyFromRow)
cloneAttribute in class BasicIndirectionPolicybuildDirectlyFromRow - indicates that we are building the clone
directly from a row as opposed to building the original from the
row, putting it in the shared cache, and then cloning the original.public java.lang.Object backupCloneAttribute(java.lang.Object attributeValue,
java.lang.Object clone,
java.lang.Object backup,
UnitOfWorkImpl unitOfWork)
backupCloneAttribute in class BasicIndirectionPolicypublic void iterateOnAttributeValue(DescriptorIterator iterator, java.lang.Object attributeValue)
iterateOnAttributeValue in class BasicIndirectionPolicypublic java.lang.Object validateAttributeOfInstantiatedObject(java.lang.Object attributeValue)
validateAttributeOfInstantiatedObject in class BasicIndirectionPolicypublic void validateDeclaredAttributeType(java.lang.Class attributeType,
IntegrityChecker checker)
throws DescriptorException
validateDeclaredAttributeType in class BasicIndirectionPolicyDescriptorExceptionpublic void validateGetMethodReturnType(java.lang.Class returnType,
IntegrityChecker checker)
throws DescriptorException
validateGetMethodReturnType in class BasicIndirectionPolicyDescriptorExceptionpublic void validateSetMethodParameterType(java.lang.Class parameterType,
IntegrityChecker checker)
throws DescriptorException
validateSetMethodParameterType in class BasicIndirectionPolicyDescriptorExceptionpublic boolean isAttributeValueFullyBuilt(java.lang.Object attributeValue)
isAttributeValueFullyBuilt in class BasicIndirectionPolicyattributeValue - validateAttributeOfInstantiatedObject(Object attributeValue)public boolean isValidType(java.lang.Class attributeType)
targetInterfaces.EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference