You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ha...@apache.org on 2013/01/19 18:39:07 UTC
svn commit: r1435620 -
/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java
Author: hadrian
Date: Sat Jan 19 17:39:06 2013
New Revision: 1435620
URL: http://svn.apache.org/viewvc?rev=1435620&view=rev
Log:
Improve example to gracefully handle imporoper use of dsl
Modified:
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java?rev=1435620&r1=1435619&r2=1435620&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java Sat Jan 19 17:39:06 2013
@@ -65,6 +65,7 @@ public class SynchPrinter {
.order("1")
.and().then().order("2")
.and().then().order("3")
+ .and().then().and().then().and().then().and().then()
.and().no().andthen();
}
@@ -94,6 +95,9 @@ public class SynchPrinter {
return this;
}
public PrinterProcess then() {
+ if (message == null) {
+ return this;
+ }
next = new PrinterProcess(printer, this);
return next;
}
@@ -106,14 +110,16 @@ public class SynchPrinter {
@Override
public void run() {
- object(receive(printer.print(message), new Synch() {
- private static final long serialVersionUID = 1L;
- public void ret() {
- if (next != null) {
- next.run();
+ if (message != null) {
+ object(receive(printer.print(message), new Synch() {
+ private static final long serialVersionUID = 1L;
+ public void ret() {
+ if (next != null) {
+ next.run();
+ }
}
- }
- }));
+ }));
+ }
}
}
}