EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.descriptors.changetracking
Class ObjectChangeTrackingPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
      extended by org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
All Implemented Interfaces:
java.io.Serializable, ObjectChangePolicy
Direct Known Subclasses:
AttributeChangeTrackingPolicy

public class ObjectChangeTrackingPolicy
extends DeferredChangeDetectionPolicy

PUBLIC: A ObjectChangeTrackingPolicy allows an object to calculate for itself whether it should has changed by implementing ChangeTracker. Changed objects will be processed in the UnitOfWork commit process to include any changes in the results of the commit. Unchanged objects will be ignored.

See Also:
DeferredChangeDetectionPolicy, ChangeTracker, Serialized Form

Constructor Summary
ObjectChangeTrackingPolicy()
           
 
Method Summary
 void clearChanges(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, boolean forRefresh)
          INTERNAL: Clear the changes in the ObjectChangeListener
 void dissableEventProcessing(java.lang.Object changeTracker)
          INTERNAL: This method is used to disable changetracking temporarily
 void enableEventProcessing(java.lang.Object changeTracker)
          INTERNAL: This method is used to enable changetracking temporarily
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
          INTERNAL: initialize the Policy
 boolean isDeferredChangeDetectionPolicy()
          Used to track instances of the change policies without doing an instance of check
 boolean isObjectChangeTrackingPolicy()
          Used to track instances of the change policies without doing an instance of check
 void raiseInternalPropertyChangeEvent(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.
 void setAggregateChangeListener(java.lang.Object parent, java.lang.Object aggregate, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, java.lang.String mappingAttribute)
          INTERNAL: Assign ChangeListener to an aggregate object
 java.beans.PropertyChangeListener setChangeListener(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
          INTERNAL: Assign ObjectChangeListener to PropertyChangeListener
 boolean shouldCompareExistingObjectForChange(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, ClassDescriptor descriptor)
          INTERNAL: Return true if the Object should be compared, false otherwise.
 
Methods inherited from class org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
buildBackupClone, calculateChanges, calculateChangesForExistingObject, calculateChangesForNewObject, createObjectChangeSet, createObjectChangeSetThroughComparison, isAttributeChangeTrackingPolicy, revertChanges, setChangeSetOnListener, updateWithChanges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectChangeTrackingPolicy

public ObjectChangeTrackingPolicy()
Method Detail

dissableEventProcessing

public void dissableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to disable changetracking temporarily

Specified by:
dissableEventProcessing in interface ObjectChangePolicy
Overrides:
dissableEventProcessing in class DeferredChangeDetectionPolicy

enableEventProcessing

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

Specified by:
enableEventProcessing in interface ObjectChangePolicy
Overrides:
enableEventProcessing in class DeferredChangeDetectionPolicy

shouldCompareExistingObjectForChange

public boolean shouldCompareExistingObjectForChange(java.lang.Object object,
                                                    org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                                    ClassDescriptor descriptor)
INTERNAL: Return true if the Object should be compared, false otherwise. In ObjectChangeTrackingPolicy or AttributeChangeTracking Policy this method will return true if the object is new, if the object is in the OptimisticReadLock list or if the listener.hasChanges() returns true.

Specified by:
shouldCompareExistingObjectForChange in interface ObjectChangePolicy
Overrides:
shouldCompareExistingObjectForChange in class DeferredChangeDetectionPolicy
Parameters:
object - the object that will be compared
unitOfWork - the active unitOfWork
descriptor - the descriptor for the current object

raiseInternalPropertyChangeEvent

public void raiseInternalPropertyChangeEvent(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

Specified by:
raiseInternalPropertyChangeEvent in interface ObjectChangePolicy
Overrides:
raiseInternalPropertyChangeEvent in class DeferredChangeDetectionPolicy

setAggregateChangeListener

public void setAggregateChangeListener(java.lang.Object parent,
                                       java.lang.Object aggregate,
                                       org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                       ClassDescriptor descriptor,
                                       java.lang.String mappingAttribute)
INTERNAL: Assign ChangeListener to an aggregate object

Specified by:
setAggregateChangeListener in interface ObjectChangePolicy
Overrides:
setAggregateChangeListener in class DeferredChangeDetectionPolicy

setChangeListener

public java.beans.PropertyChangeListener setChangeListener(java.lang.Object clone,
                                                           org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                                           ClassDescriptor descriptor)
INTERNAL: Assign ObjectChangeListener to PropertyChangeListener

Specified by:
setChangeListener in interface ObjectChangePolicy
Overrides:
setChangeListener in class DeferredChangeDetectionPolicy

clearChanges

public void clearChanges(java.lang.Object clone,
                         org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                         ClassDescriptor descriptor,
                         boolean forRefresh)
INTERNAL: Clear the changes in the ObjectChangeListener

Specified by:
clearChanges in interface ObjectChangePolicy
Overrides:
clearChanges in class DeferredChangeDetectionPolicy

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session,
                       ClassDescriptor descriptor)
INTERNAL: initialize the Policy

Specified by:
initialize in interface ObjectChangePolicy
Overrides:
initialize in class DeferredChangeDetectionPolicy

isDeferredChangeDetectionPolicy

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

Specified by:
isDeferredChangeDetectionPolicy in interface ObjectChangePolicy
Overrides:
isDeferredChangeDetectionPolicy in class DeferredChangeDetectionPolicy

isObjectChangeTrackingPolicy

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

Specified by:
isObjectChangeTrackingPolicy in interface ObjectChangePolicy
Overrides:
isObjectChangeTrackingPolicy in class DeferredChangeDetectionPolicy

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference