You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2015/02/05 02:03:09 UTC
svn commit: r939028 - in /websites/staging/isis/trunk: cgi-bin/ content/
content/reference/services/event-bus-service.html
Author: buildbot
Date: Thu Feb 5 01:03:09 2015
New Revision: 939028
Log:
Staging update by buildbot for isis
Modified:
websites/staging/isis/trunk/cgi-bin/ (props changed)
websites/staging/isis/trunk/content/ (props changed)
websites/staging/isis/trunk/content/reference/services/event-bus-service.html
Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Feb 5 01:03:09 2015
@@ -1 +1 @@
-1657449
+1657454
Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Feb 5 01:03:09 2015
@@ -1 +1 @@
-1657449
+1657454
Modified: websites/staging/isis/trunk/content/reference/services/event-bus-service.html
==============================================================================
--- websites/staging/isis/trunk/content/reference/services/event-bus-service.html (original)
+++ websites/staging/isis/trunk/content/reference/services/event-bus-service.html Thu Feb 5 01:03:09 2015
@@ -572,14 +572,22 @@ public class MySubscribingDomainService
<p>The actual callbacks of events is done by annotating a method on the class (that is, the usual Guava programming model).</p>
-<p>For example, suppose in a library domain that a <code>LibraryMember</code> wants to leave the library. A letter should be sent out detailing any books that they still have out on loan:</p>
+<p>For example, the subscriber in the todoapp for completed todo items would use the following callback:</p>
+
+<pre><code>@Programmatic
+@Subscribe
+public void on(final ToDoItem.CompletedEvent ev) { ... }
+</code></pre>
+
+<p>As a slightly more interesting example, suppose in a library domain that a <code>LibraryMember</code> wants to leave the library. A letter should be sent out detailing any books that they still have out on loan:</p>
<p>In the <code>LibraryMember</code> class, we publish the event:</p>
<pre><code>public class LibraryMember {
...
+ @Action(domainEvent=LibraryMemberLeaveEvent.class)
public void leave() {
- eventBus.post(new LibraryMemberLeaveEvent(this));
+ ...
}
...
}