| Summary: | Provide vetoable transaction hooks | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Eike Stepper <stepper> |
| Component: | cdo.core | Assignee: | Eike Stepper <stepper> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | smcduff |
| Version: | 1.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Eike Stepper
Added support for the following handler interface:
public interface CDOTransactionHandler
{
/**
* Called by a <code>CDOTransaction</code> <b>before</b> 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.
*/
public void addingObject(CDOTransaction transaction, CDOObject object);
/**
* Called by a <code>CDOTransaction</code> <b>before</b> 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.
* <p>
* Note: This method will be called at most once per object until the associated transaction is committed.
*/
public void modifyingObject(CDOTransaction transaction, CDOObject object);
/**
* Called by a <code>CDOTransaction</code> <b>before</b> 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.
*/
public void committingTransaction(CDOTransaction transaction);
}
Committed to CVS.
This will be very useful!! Thank you Eike! Basically I could add my adapter at this point... and I will be notify immediatly after. Right ? With that mechanism I will be able to react depending of the annotation in the EMF model! Thank you again! (In reply to comment #1) > Added support for the following handler interface: > public interface CDOTransactionHandler > { > /** > * Called by a <code>CDOTransaction</code> <b>before</b> 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. > */ > public void addingObject(CDOTransaction transaction, CDOObject object); > /** > * Called by a <code>CDOTransaction</code> <b>before</b> 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. > * <p> > * Note: This method will be called at most once per object until the > associated transaction is committed. > */ > public void modifyingObject(CDOTransaction transaction, CDOObject object); > /** > * Called by a <code>CDOTransaction</code> <b>before</b> 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. > */ > public void committingTransaction(CDOTransaction transaction); > } > Committed to CVS. (In reply to comment #2) > Basically I could add my adapter at this point... and I will be notify > immediatly after. Right ? I prefer to call it a handler. It doesn't need to implement emf.comon.notify.Adapter. I tend to call things like it a handler because my IListeners all listen to IEvents. Handlers break this pattern but are a bit more optimized. And yes, from the point when you've added your handler to a CDOTransaction, it receives the three notifications. I forgot to mention that I broadened the CDOTransaction API itself so that you can ask about current dirty objects and the like... > With that mechanism I will be able to react depending of the annotation in the > EMF model! That should be possible as well: InternalEObject eObject = cdoObject.cdoInternalInstance(); eObject.eClass().getEAnnotations()... Fixed in I200710101632. Move to verified as per bug 206558. Reversioned due to graduation CLOSING |