Adding transactions info to mdr events

Holger Krug <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Martin, please review this proposal. Please tell me, if you agree. If
yes I will open an issue.



It's seems to be common sense that Undo/Redo management should be
implemented on top of JMI+events. The UndoManager should listen on
repository change events.

Furthermore undo/redo should respect transaction integrity.

But currently the MDR events do not inform about transactions at
all. Hence I propose:

1) Add to interface MDRChangeEvent the method:

   MDRTransaction getTransaction(); 

which returns the innermost transaction performing the change.

The interface MDRTransaction consists solely of the method:

  public interface MDRTransaction {
    MDRTransaction getParent();
  }

returning the enclosing transaction or null.


2) Add a new event type:

  public class TransactionEvent extends MDRChangeEvent {
     public static int EVENT_TRANSACTION_START     = ..;
     public static int EVENT_TRANSACTION_COMMIT    = ..;
     public static int EVENT_TRANSACTION_ROLLBACK  = ..;

     ...

     public int getType() {
       ...
     }
  }

Only listeners on the MDRepository are informed about transaction
events.



-- 
Holger Krug
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.