Methods Summary |
---|
public java.lang.Object | clone()
try {
return super.clone();
} catch (CloneNotSupportedException exception) {
throw new InternalError();
}
|
public oracle.toplink.essentials.internal.sessions.AbstractRecord | getRow()Return the row.
return row;
|
public oracle.toplink.essentials.internal.sessions.AbstractSession | getSession()Return the session.
return session;
|
public synchronized java.lang.Object | getValue()Return the object.
if (!isInstantiated()) {
// The value must be set directly because the setValue can also cause instatiation under UOW.
privilegedSetValue(instantiate());
setInstantiated();
resetFields();
}
return value;
|
protected abstract java.lang.Object | instantiate()Instantiate the object.
|
public abstract java.lang.Object | instantiateForUnitOfWorkValueHolder(oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder unitOfWorkValueHolder)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: Implementations of this method are not necessarily thread-safe. They must
be used in a synchronizaed manner
|
public boolean | isCoordinatedWithProperty()This method is used as part of the implementation of WeavedAttributeValueHolderInterface
It is used to check whether a valueholder that has been weaved into a class is coordinated
with the underlying property
return isCoordinatedWithProperty;
|
public boolean | isEasilyInstantiated()INTERNAL:
Answers if this valueholder is easy to instantiate.
return isInstantiated();
|
public boolean | isInstantiated()Return a boolean indicating whether the object
has been read from the database or not.
return isInstantiated;
|
public boolean | isNewlyWeavedValueHolder()This method is used as part of the implementation of WeavedAttributeValueHolderInterface.
A DatabaseValueHolder is set up by TopLink and will never be a newly weaved valueholder.
As a result, this method is stubbed out.
return false;
|
public abstract boolean | isPessimisticLockingValueHolder()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: Implementations of this method are not necessarily thread-safe. They must
be used in a synchronizaed manner
|
public boolean | isSerializedRemoteUnitOfWorkValueHolder()Used to determine if this is a remote uow value holder that was serialized to the server.
It has no reference to its wrapper value holder, so must find its original object to be able to instantiate.
return false;
|
protected boolean | isTransactionalValueHolder()Answers if this valueholder is referenced only by a UnitOfWork valueholder.
I.e. it was built in valueFromRow which was called by buildCloneFromRow.
Sometimes in transaction a UnitOfWork clone, and all valueholders, are built
directly from the row; however a UnitOfWorkValueHolder does not know how to
instantiate itself so wraps this which does.
On a successful merge must be released to the session cache with
releaseWrappedValueHolder.
return ((session != null) && session.isUnitOfWork());
|
public void | privilegedSetValue(java.lang.Object value)Set the object. This is used only by the privileged methods. One must be very careful in using this method.
this.value = value;
isCoordinatedWithProperty = false;
|
public void | releaseWrappedValueHolder()Releases a wrapped valueholder privately owned by a particular unit of work.
When unit of work clones are built directly from rows no object in the shared
cache points to this valueholder, so it can store the unit of work as its
session. However once that UnitOfWork commits and the valueholder is merged
into the shared cache, the session needs to be reset to the root session, ie.
the server session.
AbstractSession session = getSession();
if ((session != null) && session.isUnitOfWork()) {
setSession(session.getRootSession(null));
}
|
protected void | resetFields()Reset all the fields that are not needed after instantiation.
setRow(null);
setSession(null);
|
public void | setInstantiated()Set the instantiated flag to true.
isInstantiated = true;
|
public void | setIsCoordinatedWithProperty(boolean coordinated)This method is used as part of the implementation of WeavedAttributeValueHolderInterface
It is used internally by TopLink to set whether a valueholder that has been weaved into a class is coordinated
with the underlying property
this.isCoordinatedWithProperty = coordinated;
|
public void | setIsNewlyWeavedValueHolder(boolean isNew)This method is used as part of the implementation of WeavedAttributeValueHolderInterface
A DatabaseValueHolder is set up by TopLink and will never be a newly weaved valueholder
As a result, this method is stubbed out.
|
public void | setRow(oracle.toplink.essentials.internal.sessions.AbstractRecord row)Set the row.
this.row = row;
|
public void | setSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)Set the session.
this.session = session;
|
public void | setUninstantiated()Set the instantiated flag to false.
isInstantiated = false;
|
public void | setValue(java.lang.Object value)Set the object.
this.value = value;
setInstantiated();
|
public java.lang.String | toString()
if (isInstantiated()) {
return "{" + getValue() + "}";
} else {
return "{" + Helper.getShortClassName(getClass()) + ": " + ToStringLocalization.buildMessage("not_instantiated", (Object[])null) + "}";
}
|