com.objectwave.transactionalSupport
Class NoFieldObjectModified

java.lang.Object
  |
  +--com.objectwave.transactionalSupport.NoFieldObjectModified
All Implemented Interfaces:
ObjectChangeRequest

public class NoFieldObjectModified
extends java.lang.Object
implements ObjectChangeRequest

The details of a change to a particular object. Every change will create an NoFieldObjectModified object. There will be only one NoFieldObjectModified instance per attribute per transaction. Only 1 thread will be calling get and set with this class.

Version:
$Id: NoFieldObjectModified.java,v 1.2 2002/03/23 13:42:11 dave_hoag Exp $
Author:
dhoag

Nested Class Summary
static class NoFieldObjectModified.Test
           
 
Constructor Summary
protected NoFieldObjectModified()
           
 
Method Summary
protected  void clean()
           
 void commit(boolean force)
          Place the new value into the domain object.
 java.lang.Object currentValue()
           
protected  void initObjectModified(NoFieldObjectEditor backReference, int adapt, TransactionalObjectIF theInstance, java.lang.Object newVal, java.lang.Object old, java.lang.Class adapterType)
          Set the changed values.
 boolean isCollection()
          Is this field representing an Array, Hashtable, or a Vector?
 java.lang.Object originalValue()
           
 boolean returnThis()
          A workaround for a small problem
 void rollback()
          Change the domain object to contain the 'old' value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoFieldObjectModified

protected NoFieldObjectModified()
Method Detail

isCollection

public boolean isCollection()
Is this field representing an Array, Hashtable, or a Vector?

Specified by:
isCollection in interface ObjectChangeRequest
Returns:
The Collection value

returnThis

public boolean returnThis()
A workaround for a small problem

Returns:

clean

protected void clean()

initObjectModified

protected void initObjectModified(NoFieldObjectEditor backReference,
                                  int adapt,
                                  TransactionalObjectIF theInstance,
                                  java.lang.Object newVal,
                                  java.lang.Object old,
                                  java.lang.Class adapterType)
Set the changed values.

Parameters:
backReference -
adapt -
theInstance -
newVal -
old -
adapterType -

commit

public void commit(boolean force)
            throws UpdateException
Place the new value into the domain object. Prior to updating the domain object we validate that no one else has updated this particular field in the domain object. If someone has, an UpdateException will be thrown.

Specified by:
commit in interface ObjectChangeRequest
Parameters:
force - Override the default behavior of checking if the object has changed.
Throws:
UpdateException

currentValue

public java.lang.Object currentValue()
Specified by:
currentValue in interface ObjectChangeRequest
Returns:
Object The 'current' value of the Object. This is NOT actually what value is found in the domain object. Rather what the value will be when the change is committed.

originalValue

public java.lang.Object originalValue()
Specified by:
originalValue in interface ObjectChangeRequest
Returns:
Object value found in the domain object when this change occurred.

rollback

public void rollback()
Change the domain object to contain the 'old' value. There is nothing to rollback if I did not commit.

Specified by:
rollback in interface ObjectChangeRequest