org.eclipse.emf.cdo.transaction
Class CDODefaultTransactionHandler1

java.lang.Object
  extended by org.eclipse.emf.cdo.transaction.CDODefaultTransactionHandler1
All Implemented Interfaces:
CDOTransactionHandler1, CDOTransactionHandlerBase
Direct Known Subclasses:
CDOAutoAttacher, CDODefaultTransactionHandler

public abstract class CDODefaultTransactionHandler1
extends Object
implements CDOTransactionHandler1

Since:
4.0
Author:
Eike Stepper

Constructor Summary
protected CDODefaultTransactionHandler1()
           
 
Method Summary
 void attachingObject(CDOTransaction transaction, CDOObject object)
          Called by a CDOTransaction before an object is added.
 void detachingObject(CDOTransaction transaction, CDOObject object)
          Called by a CDOTransaction before an object is detached.
 void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureChange)
          Called by a CDOTransaction before an object is modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDODefaultTransactionHandler1

protected CDODefaultTransactionHandler1()
Method Detail

attachingObject

public void attachingObject(CDOTransaction transaction,
                            CDOObject object)
Description copied from interface: CDOTransactionHandler1
Called by a CDOTransaction before an object is added. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to add the object (thereby preventing the operation from successful completion).

Note: Implementors must not start threads which access the view and wait for their completion since deadlocks can result. The following example causes a deadlock:

 getDisplay().syncExec(new Runnable()
 {
   public void run()
   {
     try
     {
       cdoObject.getName();
     }
     catch (Exception ignore)
     {
     }
   }
 });
 
If you need to synchronously execute threads which access the view you should use CDOAsyncTransactionHandler.

Specified by:
attachingObject in interface CDOTransactionHandler1

detachingObject

public void detachingObject(CDOTransaction transaction,
                            CDOObject object)
Description copied from interface: CDOTransactionHandler1
Called by a CDOTransaction before an object is detached. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to remove the object (thereby preventing the operation from completing successfully).

Note: Implementors must not start threads which access the view and wait for their completion since deadlocks can result. The following example causes a deadlock:

 getDisplay().syncExec(new Runnable()
 {
   public void run()
   {
     try
     {
       cdoObject.getName();
     }
     catch (Exception ignore)
     {
     }
   }
 });
 
If you need to synchronously execute threads which access the view you should use CDOAsyncTransactionHandler.

Specified by:
detachingObject in interface CDOTransactionHandler1

modifyingObject

public void modifyingObject(CDOTransaction transaction,
                            CDOObject object,
                            CDOFeatureDelta featureChange)
Description copied from interface: CDOTransactionHandler1
Called by a CDOTransaction before an object is modified. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to modify the object (thereby preventing the operation from completing successfully).

Note: Implementors must not start threads which access the view and wait for their completion since deadlocks can result. The following example causes a deadlock:

 getDisplay().syncExec(new Runnable()
 {
   public void run()
   {
     try
     {
       cdoObject.getName();
     }
     catch (Exception ignore)
     {
     }
   }
 });
 
If you need to synchronously execute threads which access the view you should use CDOAsyncTransactionHandler.

Specified by:
modifyingObject in interface CDOTransactionHandler1


Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.