You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Erdinç Kocaman <ko...@yahoo.com> on 2009/11/19 17:52:19 UTC

Order of callback methods

Hi,

I have a listener object implementing LifecycleListener and it listens all events of all data objects. And also data objects has listener methods like onPreUpdate() which is set on modeler.  I want to know which listener methods are called first when any event occurred. Is the first object called when event occurred the listener object implementing LifecycleListener or data objects having preUpdate() listener methods? Or is there any order when invoking callback methods??

Thanks,


      

Re: Order of callback methods

Posted by Andrey Razumovsky <ra...@gmail.com>.
Hi,

Callbacks and listeners are invoked in order they were added to
LifecycleCallbackRegistry. *BUT *when Cayenne saves the project, listeners
are written *before* callbacks, so unless you're adding listeners/callbacks
from the code there's no actual way to change this order (you can change it
manually in *map.xml, but it will get lost next time project is saved in
modeler

2009/11/19 Erdinç Kocaman <ko...@yahoo.com>

> Hi,
>
> I have a listener object implementing LifecycleListener and it listens all
> events of all data objects. And also data objects has listener methods like
> onPreUpdate() which is set on modeler.  I want to know which listener
> methods are called first when any event occurred. Is the first object called
> when event occurred the listener object implementing LifecycleListener or
> data objects having preUpdate() listener methods? Or is there any order when
> invoking callback methods??
>
> Thanks,
>
>
>




-- 
Andrey