[CDO] Event to notify object has become dirty [message #1007873] |
Thu, 07 February 2013 20:37 |
Jack Lechner Messages: 12 Registered: December 2012 |
Junior Member |
|
|
Hi!
I'm currently using a listener attached the cdoView of my object that updates some objects when the cdoState of my object changes. I receive CDOViewInvalidationEvents for when a passive update makes my object conflicted and CDOTransactionFinishedEvents for when the object is clean after a successful commit. Is there an event I can use to determine that it has become dirty?
Thank you in advance!
Edit: Found a better solution by using this:
cdoView.addObjectHandler(new CDOObjectHandler() {
@Override
public void objectStateChanged(CDOView view, CDOObject object,
CDOState oldState, CDOState newState) {
System.out.println("Object: " + object.toString()
+ " transitioned to " + newState);
}
});
[Updated on: Thu, 07 February 2013 21:08] Report message to a moderator
|
|
|
Re: [CDO] Event to notify object has become dirty [message #1007989 is a reply to message #1007873] |
Fri, 08 February 2013 05:20 |
|
Am 07.02.2013 21:37, schrieb Jack Lechner:
> Hi!
>
> I'm currently using a listener attached the cdoView of my object that updates some objects when the cdoState of my
> object changes. I receive CDOViewInvalidationEvents for when a passive update makes my object conflicted and
> CDOTransactionFinishedEvents for when the object is clean after a successful commit. Is there an event I can use to
> determine that it has become dirty?
The general "notification rule" in Net4j and CDO is that low frequency events are fired as IEvents to IListeners and
high frequency "events" are delivered to the application as direct method calls on handler call-backs (to avoid the
creation of events on the heap).Object state changes occur with high frequency, that's why there is
CDOView.addObjectHandler(CDOObjectHandler):
public interface CDOObjectHandler
{
public void objectStateChanged(CDOView view, CDOObject object, CDOState oldState, CDOState newState);
}
There's also CDOTransaction.addTransactionHandler(CDOTransactionHandlerBase):
CDOTransactionHandler1.attachingObject(CDOTransaction, CDOObject)
CDOTransactionHandler1.detachingObject(CDOTransaction, CDOObject)
CDOTransactionHandler1.modifyingObject(CDOTransaction, CDOObject, CDOFeatureDelta)
CDOTransactionHandler2.committingTransaction(CDOTransaction, CDOCommitContext)
CDOTransactionHandler2.committedTransaction(CDOTransaction, CDOCommitContext)
CDOTransactionHandler2.rolledBackTransaction(CDOTransaction)
CDOTransactionHandler3.committedTransaction(CDOTransaction, CDOCommitContext, CDOCommitInfo)
Does that help?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds