cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1484116 - /cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml
Date Sat, 18 May 2013 13:32:35 GMT
Author: aadamchik
Date: Sat May 18 13:32:34 2013
New Revision: 1484116

URL: http://svn.apache.org/r1484116
Log:
docs update for CAY-1819, CAY-1820

Modified:
    cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml

Modified: cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml?rev=1484116&r1=1484115&r2=1484116&view=diff
==============================================================================
--- cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml (original)
+++ cayenne/main/trunk/docs/docbook/cayenne-guide/src/docbkx/lifecycle-events.xml Sat May
18 13:32:34 2013
@@ -194,11 +194,8 @@ public class Listener2 {
             methods. Now let's register them with
             runtime:<programlisting language="java">ServerRuntime runtime = ...
 
-LifecycleCallbackRegistry registry = 
-    runtime.getDataDomain().getEntityResolver().getCallbackRegistry();
-
-registry.addListener(new Listener1());
-registry.addListener(new Listener2());</programlisting></para>
+runtime.getDataDomain().addListener(new Listener1());
+runtime.getDataDomain().addListener(new Listener2());</programlisting></para>
         <para>Listeners in this example are very simple. However they don't have to
be. Unlike
             Persistent objects, normally listeners initialization is managed by the application
             code, not Cayenne, so listeners may have knowledge of various application services,
@@ -310,9 +307,7 @@ ServerRuntime runtime = ...
 DataDomain domain = runtime.getDataDomain();
 
 // register filter
-domain.addFilter(counter);
-
-// register listener
-domain.getEntityResolver().getCallbackRegistry().addListener(counter);</programlisting></para>
+// this will also add it as a listener (since 3.2)
+domain.addFilter(counter);</programlisting></para>
     </section>
 </chapter>



Mime
View raw message