org.eclipse.emf.cdo.transaction
Class CDODefaultTransactionHandler

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

public abstract class CDODefaultTransactionHandler
extends java.lang.Object
implements CDOTransactionHandler

Since:
2.0

Constructor Summary
protected CDODefaultTransactionHandler()
           
 
Method Summary
 void attachingObject(CDOTransaction transaction, CDOObject object)
          Called by a CDOTransaction before an object is added.
 void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
          Called by a CDOTransaction after it is being committed.
 void committingTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
          Called by a CDOTransaction before it is being committed.
 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.
 void rolledBackTransaction(CDOTransaction transaction)
          Called by a CDOTransaction after it is rolled back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDODefaultTransactionHandler

protected CDODefaultTransactionHandler()
Method Detail

attachingObject

public void attachingObject(CDOTransaction transaction,
                            CDOObject object)
Description copied from interface: CDOTransactionHandler
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 CDOTransactionHandler

detachingObject

public void detachingObject(CDOTransaction transaction,
                            CDOObject object)
Description copied from interface: CDOTransactionHandler
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 CDOTransactionHandler

modifyingObject

public void modifyingObject(CDOTransaction transaction,
                            CDOObject object,
                            CDOFeatureDelta featureChange)
Description copied from interface: CDOTransactionHandler
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 CDOTransactionHandler

committingTransaction

public void committingTransaction(CDOTransaction transaction,
                                  CDOCommitContext commitContext)
Description copied from interface: CDOTransactionHandler
Called by a CDOTransaction before it is being committed. The implementor of this method is allowed to throw an unchecked exception that will propagate up to the operation that is about to commit the transaction (thereby preventing the operation from completing successfully).

Specified by:
committingTransaction in interface CDOTransactionHandler

rolledBackTransaction

public void rolledBackTransaction(CDOTransaction transaction)
Description copied from interface: CDOTransactionHandler
Called by a CDOTransaction after it is rolled back. If the implementor of this method throws an exception it will be logged as an error and subsequent handlers will be further called.

Specified by:
rolledBackTransaction in interface CDOTransactionHandler

committedTransaction

public void committedTransaction(CDOTransaction transaction,
                                 CDOCommitContext commitContext)
Description copied from interface: CDOTransactionHandler
Called by a CDOTransaction after it is being committed. The implementor of this method is not allowed to throw an unchecked exception.

Specified by:
committedTransaction in interface CDOTransactionHandler

Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
All Rights Reserved.