Package org.eclipse.emf.cdo.transaction
Class CDOPostEventTransactionHandler
- java.lang.Object
-
- org.eclipse.emf.cdo.transaction.CDOPostEventTransactionHandler
-
- All Implemented Interfaces:
CDOTransactionHandler,CDOTransactionHandler1,CDOTransactionHandler2,CDOTransactionHandlerBase
- Direct Known Subclasses:
CDOPostEventTransactionHandler.Default
public abstract class CDOPostEventTransactionHandler extends java.lang.Object implements CDOTransactionHandler
An abstract call-back class that is called by atranscationafterobjectshave been attached, modified or detached.- Since:
- 4.1
- Author:
- Martin Fluegge
- See Also:
CDOTransactionHandler1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCDOPostEventTransactionHandler.DefaultAn empty default implementation ofCDOPostEventTransactionHandler.-
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.transaction.CDOTransactionHandler1
CDOTransactionHandler1.WithUndo
-
-
Constructor Summary
Constructors Constructor Description CDOPostEventTransactionHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidattachedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)voidattachingObject(CDOTransaction transaction, CDOObject object)Called by aCDOTransactionbefore an object is added.voidcommittedTransaction(CDOTransaction transaction, CDOCommitContext commitContext)Called by aCDOTransactionafter it is being committed.voidcommittingTransaction(CDOTransaction transaction, CDOCommitContext commitContext)Called by aCDOTransactionbefore it is being committed.protected abstract voiddetachedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)voiddetachingObject(CDOTransaction transaction, CDOObject object)Called by aCDOTransactionbefore an object is detached.protected abstract voidmodifiedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)voidmodifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)Called by aCDOTransactionbefore an object is modified.voidrolledBackTransaction(CDOTransaction transaction)Called by aCDOTransactionafter it is rolled back.
-
-
-
Method Detail
-
attachingObject
public void attachingObject(CDOTransaction transaction, CDOObject object)
Description copied from interface:CDOTransactionHandler1Called by aCDOTransactionbefore 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
viewand 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 theviewyou should useCDOAsyncTransactionHandler.- Specified by:
attachingObjectin interfaceCDOTransactionHandler1
-
modifyingObject
public void modifyingObject(CDOTransaction transaction, CDOObject object, CDOFeatureDelta featureDelta)
Description copied from interface:CDOTransactionHandler1Called by aCDOTransactionbefore 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
viewand 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 theviewyou should useCDOAsyncTransactionHandler.- Specified by:
modifyingObjectin interfaceCDOTransactionHandler1
-
detachingObject
public void detachingObject(CDOTransaction transaction, CDOObject object)
Description copied from interface:CDOTransactionHandler1Called by aCDOTransactionbefore 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
viewand 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 theviewyou should useCDOAsyncTransactionHandler.- Specified by:
detachingObjectin interfaceCDOTransactionHandler1
-
committingTransaction
public void committingTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
Description copied from interface:CDOTransactionHandler2Called by aCDOTransactionbefore 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). The implementor of this method is allowed to apply changes to the object graph managed by the transaction.- Specified by:
committingTransactionin interfaceCDOTransactionHandler2
-
committedTransaction
public void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
Description copied from interface:CDOTransactionHandler2Called by aCDOTransactionafter it is being committed. The implementor of this method is not allowed to throw an unchecked exception.If you're interested in the results of the commit operation consider to implement
CDOTransactionHandler3.committedTransaction().- Specified by:
committedTransactionin interfaceCDOTransactionHandler2
-
rolledBackTransaction
public void rolledBackTransaction(CDOTransaction transaction)
Description copied from interface:CDOTransactionHandler2Called by aCDOTransactionafter 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:
rolledBackTransactionin interfaceCDOTransactionHandler2
-
attachedObject
protected abstract void attachedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)
-
modifiedObject
protected abstract void modifiedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)
-
detachedObject
protected abstract void detachedObject(CDOTransaction transaction, CDOObject object, org.eclipse.emf.common.notify.Notification msg)
-
-