Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions.remote

public Class RemoteValueHolder<T>

extends DatabaseValueHolder<T>
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.rmi.server.ObjID, java.io.*, org.eclipse.persistence.sessions.remote.*, org.eclipse.persistence.queries.*, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.indirection.*, org.eclipse.persistence.internal.sessions.AbstractRecord, org.eclipse.persistence.indirection.*, org.eclipse.persistence.mappings.*

Remote value holders can be invoked locally and remotely. In both situations the associated indirect object is invoked.

Field Summary

Modifier and TypeField and Description
protected ObjID
protected transient DatabaseMapping
protected transient ObjectLevelReadQuery
protected transient Object
protected Object
protected transient ValueHolderInterface<T>
Inherited from org.eclipse.persistence.internal.indirection.DatabaseValueHolder:
isCoordinatedWithPropertyisInstantiatedrowsessionvalue

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
canDoCacheCheck()

If the reference object is mapped thru one to one mapping and the object derives its primary key value from this relationship then remote value holder has a primary key row for.

public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Only the id is checked for equality check.
public void
finalize()

Overrides java.lang.Object.finalize.

This method is used to remove the RemoteValueHolder from the dispatcher on Garbage collection from the client
public ObjID
getID()

Return the unique id.

public DatabaseMapping
getMapping()

Return the associated mapping.

protected Object
getObjectFromCache()

Get object from the cache if there is one.

public ObjectLevelReadQuery
getQuery()

Return the associated query.

public Object
getServerIndirectionObject()

Return the object on the server that holds on to the remote value holder.

protected Object
getTargetObjectPrimaryKeys()

Get target object primary key row.

public ValueHolderInterface<T>
getWrappedServerValueHolder()

Return the original value holder.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Return the hashcode for id, because it is unqiue.
public synchronized T
public T
instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder<T> unitOfWorkValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiateForUnitOfWorkValueHolder.

Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).
public boolean

Returns:

true if getValue() won't trigger a database read.
isEasilyInstantiated
()

Overrides org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isEasilyInstantiated.

INTERNAL: Answers if this valueholder is easy to instantiate.
public boolean
isPessimisticLockingValueHolder()

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isPessimisticLockingValueHolder.

INTERNAL: Answers if this valueholder is a pessimistic locking one.
public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

Override the default serialization for a remote valueholder so as not to serialize the value Note: Changed for bug 3145211.
protected void
setID(ObjID anID)

Set the unique id.

public void
setMapping(DatabaseMapping mapping)

Set mapping

public void
setQuery(ObjectLevelReadQuery query)

Set the query.

public void
setServerIndirectionObject(Object serverIndirectionObject)

Set the object on the server that holds on to the remote value holder.

public void
setTargetObjectPrimaryKeys(Object primaryKeys)

Set target object primary keys.

public void
public void
setWrappedServerValueHolder(ValueHolderInterface<T> wrappedServerValueHolder)

Set the original value holder.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

Override the default serialization for a remote valueholder so as not to serialize the value Note: Changed for bug 3145211.
Inherited from org.eclipse.persistence.internal.indirection.DatabaseValueHolder:
clonegetRowgetSessiongetValuegetValuegetWrappedValueHolderisCoordinatedWithPropertyisInstantiatedisNewlyWeavedValueHolderisSerializedRemoteUnitOfWorkValueHolderisTransactionalValueHolderpostInstantiateprivilegedSetValuereleaseWrappedValueHolderresetFieldssetInstantiatedsetIsCoordinatedWithPropertysetIsNewlyWeavedValueHoldersetRowsetSessionsetUninstantiatedshouldAllowInstantiationDeferraltoString

Field Detail

idback to summary
protected ObjID id
mappingback to summary
protected transient DatabaseMapping mapping
queryback to summary
protected transient ObjectLevelReadQuery query
serverIndirectionObjectback to summary
protected transient Object serverIndirectionObject
targetObjectPrimaryKeysback to summary
protected Object targetObjectPrimaryKeys
wrappedServerValueHolderback to summary
protected transient ValueHolderInterface<T> wrappedServerValueHolder

Constructor Detail

RemoteValueHolderback to summary
public RemoteValueHolder()
RemoteValueHolderback to summary
public RemoteValueHolder(ObjID id)

Method Detail

canDoCacheCheckback to summary
protected boolean canDoCacheCheck()

If the reference object is mapped thru one to one mapping and the object derives its primary key value from this relationship then remote value holder has a primary key row for.

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Only the id is checked for equality check.

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
finalizeback to summary
public void finalize()

Overrides java.lang.Object.finalize.

This method is used to remove the RemoteValueHolder from the dispatcher on Garbage collection from the client

Annotations
@Override
getIDback to summary
public ObjID getID()

Return the unique id.

getMappingback to summary
public DatabaseMapping getMapping()

Return the associated mapping.

getObjectFromCacheback to summary
protected Object getObjectFromCache()

Get object from the cache if there is one.

getQueryback to summary
public ObjectLevelReadQuery getQuery()

Return the associated query.

getServerIndirectionObjectback to summary
public Object getServerIndirectionObject()

Return the object on the server that holds on to the remote value holder. Currently used only by TransparentIndirection so we can get back to the original IndirectContainer.

getTargetObjectPrimaryKeysback to summary
protected Object getTargetObjectPrimaryKeys()

Get target object primary key row.

getWrappedServerValueHolderback to summary
public ValueHolderInterface<T> getWrappedServerValueHolder()

Return the original value holder. This is null on the client side because it is tagged transient. This is how we know whether the remote value holder is being invoked on the client or on the server.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Return the hashcode for id, because it is unqiue.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
instantiateback to summary
public synchronized T instantiate()

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiate.

Return the object.

Annotations
@Override
@SuppressWarnings:unchecked
instantiateForUnitOfWorkValueHolderback to summary
public T instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder<T> unitOfWorkValueHolder)

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.instantiateForUnitOfWorkValueHolder.

Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this).

When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder needs to be triggered directly without triggering the wrapped valueholder. However only the wrapped valueholder knows how to trigger the indirection, i.e. it may be a batchValueHolder, and it stores all the info like the row and the query.

Note

This method is not thread-safe. It must be used in a synchronizaed manner

Annotations
@Override
isEasilyInstantiatedback to summary
public boolean isEasilyInstantiated()

Overrides org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isEasilyInstantiated.

INTERNAL: Answers if this valueholder is easy to instantiate.

Returns:boolean

true if getValue() won't trigger a database read.

Annotations
@Override
isPessimisticLockingValueHolderback to summary
public boolean isPessimisticLockingValueHolder()

Implements abstract org.eclipse.persistence.internal.indirection.DatabaseValueHolder.isPessimisticLockingValueHolder.

INTERNAL: Answers if this valueholder is a pessimistic locking one. Such valueholders are special in that they can be triggered multiple times by different UnitsOfWork. Each time a lock query will be issued. Hence even if instantiated it may have to be instantiated again, and once instantatiated all fields can not be reset.

Note

This method is not thread-safe. It must be used in a synchronizaed manner

Annotations
@Override
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Override the default serialization for a remote valueholder so as not to serialize the value Note: Changed for bug 3145211. We used to use the java.io.Serializable interface, but need to convert to Externalizable interface to avoid sending extra data through the superclass's serialization

Parameters
in:ObjectInput

Doc from java.io.Externalizable.readExternal.

the stream to read data from in order to restore the object

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.readExternal.

if I/O errors occur

ClassNotFoundException:

Doc from java.io.Externalizable.readExternal.

If the class for an object being restored cannot be found.

setIDback to summary
protected void setID(ObjID anID)

Set the unique id.

setMappingback to summary
public void setMapping(DatabaseMapping mapping)

Set mapping

setQueryback to summary
public void setQuery(ObjectLevelReadQuery query)

Set the query.

setServerIndirectionObjectback to summary
public void setServerIndirectionObject(Object serverIndirectionObject)

Set the object on the server that holds on to the remote value holder. Currently used only by TransparentIndirection so we can get back to the original IndirectContainer.

setTargetObjectPrimaryKeysback to summary
public void setTargetObjectPrimaryKeys(Object primaryKeys)

Set target object primary keys.

setValueback to summary
public void setValue(T theValue)

Overrides org.eclipse.persistence.internal.indirection.DatabaseValueHolder.setValue.

Implements org.eclipse.persistence.indirection.ValueHolderInterface.setValue.

Set the object.

Annotations
@Override
setWrappedServerValueHolderback to summary
public void setWrappedServerValueHolder(ValueHolderInterface<T> wrappedServerValueHolder)

Set the original value holder.

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Override the default serialization for a remote valueholder so as not to serialize the value Note: Changed for bug 3145211. We used to use the java.io.Serializable interface, but need to convert to Externalizable interface to avoid sending extra data through the superclass's serialization

Parameters
out:ObjectOutput

Doc from java.io.Externalizable.writeExternal.

the stream to write the object to

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Externalizable.writeExternal.

Includes any I/O exceptions that may occur