FileDocCategorySizeDatePackage
ObjectChangePolicy.javaAPI DocGlassfish v2 API7506Tue May 22 16:54:16 BST 2007oracle.toplink.essentials.descriptors.changetracking

ObjectChangePolicy

public interface ObjectChangePolicy implements Serializable
INTERNAL: Implementers of ObjectChangePolicy implement the code which computes changes sets for TopLink's UnitOfWork commit process. An ObjectChangePolicy is stored on an Object's descriptor.
see
DeferredChangeDetectionPolicy
see
ObjectChangeTrackingPolicy
see
AttributeChangeTrackingPolicy
author
Tom Ware

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectbuildBackupClone(java.lang.Object clone, oracle.toplink.essentials.internal.descriptors.ObjectBuilder builder, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Build back up clone.

public oracle.toplink.essentials.internal.sessions.ObjectChangeSetcalculateChanges(java.lang.Object clone, java.lang.Object backUp, oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet changes, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, boolean shouldRiseEvent)
INTERNAL: calculateChanges creates a change set for a particular object

return
oracle.toplink.essentials.changesets.ObjectChangeSet an object change set describing the changes to this object
param
clone the Object to compute a change set for
param
backUp the old version of the object to use for comparison
param
changes the change set to add changes to
param
session the current session
param
descriptor the descriptor for this object
param
shouldRiseEvent indicates whether PreUpdate event should be risen (usually true)

public voidclearChanges(java.lang.Object object, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: This is a place holder for reseting the listener on one of the subclasses

public oracle.toplink.essentials.internal.sessions.ObjectChangeSetcreateObjectChangeSetThroughComparison(java.lang.Object clone, java.lang.Object backUp, oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet changeSet, boolean isNew, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: Create ObjectChangeSet through comparison. Used in cases where we need to force change calculation (ie aggregates)

public voiddissableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to dissable changetracking temporarily

public voidenableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to enable changetracking temporarily

public voidinitialize(oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: initialize the Policy

public booleanisAttributeChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of check

public booleanisDeferredChangeDetectionPolicy()
Used to track instances of the change policies without doing an instance of check

public booleanisObjectChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of check

public voidraiseInternalPropertyChangeEvent(java.lang.Object source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
INTERNAL: This may cause a property change event to be raised to a listner in the case that a listener exists. If there is no listener then this call is a no-op

public voidrevertChanges(java.lang.Object clone, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, oracle.toplink.essentials.internal.helper.IdentityHashtable cloneMapping)
INTERNAL: This method is used to revert an object within the unit of work

public voidsetAggregateChangeListener(java.lang.Object parent, java.lang.Object aggregate, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, java.lang.String mappingAttribute)
INTERNAL: Assign Changelistner to an aggregate object

public voidsetChangeListener(java.lang.Object clone, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: Assign appropriate ChangeListener to PropertyChangeListener based on the policy.

public voidsetChangeSetOnListener(oracle.toplink.essentials.internal.sessions.ObjectChangeSet objectChangeSet, java.lang.Object clone)
INTERNAL: Set the ObjectChangeSet on the Listener, initially used for aggregate support

public booleanshouldCompareForChange(java.lang.Object object, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl unitOfWork, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: Return true if the Object should be compared, false otherwise. This method is implemented to allow run time determination of whether a change set should be computed for an object. In general, calculateChanges() will only be executed in a UnitOfWork if this method returns true.

param
object the object that will be compared
param
unitOfWork the active unitOfWork
param
descriptor the descriptor for the current object

public voidupdateWithChanges(java.lang.Object clone, oracle.toplink.essentials.internal.sessions.ObjectChangeSet objectChangeSet, oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)
INTERNAL: This method is used internally to rest the policies back to original state This is used when the clones are to be reused.