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/17 02:52:53 UTC
svn commit: r1434536 - in /ode/trunk:
bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/
jacob/src/main/java/org/apache/ode/jacob/
jacob/src/test/java/org/apache/ode/jacob/examples/cell/
Author: hadrian
Date: Thu Jan 17 01:52:53 2013
New Revision: 1434536
URL: http://svn.apache.org/viewvc?rev=1434536&view=rev
Log:
ODE-987. Remove use of more *Channels...
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/CELL_.java
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/JacobCellTest.java
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java?rev=1434536&r1=1434535&r2=1434536&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java Thu Jan 17 01:52:53 2013
@@ -43,7 +43,6 @@ import org.apache.ode.jacob.ReceiveProce
import org.apache.ode.jacob.Synch;
import org.apache.ode.jacob.SynchChannel;
import org.apache.ode.jacob.Val;
-import org.apache.ode.jacob.ValChannel;
import org.w3c.dom.Element;
/**
@@ -70,7 +69,7 @@ public class SCOPEACT extends ACTIVITY {
// Depending on whether we are ATOMIC or not, we'll need to create outgoing link status interceptors
LinkFrame linkframe;
if (((OScope) _self.o).atomicScope && !_self.o.outgoingLinks.isEmpty()) {
- ValChannel linkInterceptorControl = newChannel(ValChannel.class);
+ Val linkInterceptorControl = newChannel(Val.class);
ParentScopeChannel psc = newChannel(ParentScopeChannel.class);
linkframe = createInterceptorLinkFrame();
instance(new LINKSTATUSINTERCEPTOR(linkInterceptorControl,linkframe));
@@ -131,7 +130,7 @@ public class SCOPEACT extends ACTIVITY {
private static final long serialVersionUID = 3104008741240676253L;
/** We'll listen here for notification that its ok to send links status out. */
- private final ValChannel _self;
+ private final Val _self;
private final LinkFrame _interceptedChannels;
@@ -141,7 +140,7 @@ public class SCOPEACT extends ACTIVITY {
/** NULL means defer links, TRUE means passthrough, FALSE means send FALSE */
private Boolean _status;
- LINKSTATUSINTERCEPTOR(ValChannel self, LinkFrame interceptedChannels) {
+ LINKSTATUSINTERCEPTOR(Val self, LinkFrame interceptedChannels) {
_self = self;
_interceptedChannels = interceptedChannels;
}
@@ -243,7 +242,7 @@ public class SCOPEACT extends ACTIVITY {
final ParentScopeChannel parent = _self.parent;
_self.parent = newChannel(ParentScopeChannel.class);
- ValChannel lsi = newChannel(ValChannel.class);
+ Val lsi = newChannel(Val.class);
instance(new UNLOCKER(_self.parent, parent, _synchChannel, _locksAcquired, lsi));
LinkFrame linkframe = createInterceptorLinkFrame();
instance(new LINKSTATUSINTERCEPTOR(lsi,linkframe));
@@ -294,11 +293,10 @@ public class SCOPEACT extends ACTIVITY {
private final List<IsolationLock> _locks;
- private final ValChannel _linkStatusInterceptor;
+ private final Val _linkStatusInterceptor;
public UNLOCKER(ParentScopeChannel self, ParentScopeChannel parent, SynchChannel synchChannel,
- List<IsolationLock> locksAcquired,
- ValChannel linkStatusInterceptor) {
+ List<IsolationLock> locksAcquired, Val linkStatusInterceptor) {
_self = self;
_parent = parent;
_synchChannel = synchChannel;
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java?rev=1434536&r1=1434535&r2=1434536&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java Thu Jan 17 01:52:53 2013
@@ -33,18 +33,18 @@ import java.util.Set;
* <code>Cell(s,v) := s ? { read(...) = ... & write(...) = ... }</code> would
* be represented by the following Java class: <code>
* <pre>
- * public class Cell extends JacobRunnable {
- * private CellChannel s;
+ * public class CellProcess extends JacobRunnable {
+ * private Cell s;
*
* private Object v;
*
- * public Cell(CellChannel s, Object v) {
+ * public CellProcess(Cell s, Object v) {
* this.s = s;
* this.v = v;
* }
*
* public void run() {
- * object(new CellChannelListener(s) { read(...) {...}
+ * object(new ReceiveProcess<Cell> { read(...) {...}
* write(...) {...} } );
* }
* }
@@ -54,9 +54,9 @@ import java.util.Set;
* <pre>
* .
* .
- * // (new c) Cell(c,v)
+ * // (new c) CellProcess(c,v)
* Integer v = Integer.valueOf(0);
- * CellChannel c = (CellChannel)newChannel(CellChannel.class);
+ * Cell c = (Cell)newChannel(Cell.class);
* instance(new Cell(c, v));
* .
* .
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/CELL_.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/CELL_.java?rev=1434536&r1=1434535&r2=1434536&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/CELL_.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/CELL_.java Thu Jan 17 01:52:53 2013
@@ -32,11 +32,11 @@ import org.apache.ode.jacob.Val;
public class CELL_<T> extends JacobRunnable {
private static final long serialVersionUID = 1550566086202728251L;
- private CellChannel _self;
+ private Cell _self;
private T _val;
- public CELL_(CellChannel self, T val) {
+ public CELL_(Cell self, T val) {
_self = self;
_val = val;
}
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/JacobCellTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/JacobCellTest.java?rev=1434536&r1=1434535&r2=1434536&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/JacobCellTest.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/cell/JacobCellTest.java Thu Jan 17 01:52:53 2013
@@ -26,7 +26,6 @@ import junit.framework.TestCase;
import org.apache.ode.jacob.JacobRunnable;
import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.Val;
-import org.apache.ode.jacob.ValChannel;
import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
import org.apache.ode.jacob.vpu.JacobVPU;
@@ -34,45 +33,43 @@ import org.apache.ode.jacob.vpu.JacobVPU
public class JacobCellTest extends TestCase {
private static Object _val;
- public JacobCellTest(String testName) {
- super(testName);
- }
-
- public void testJacobCell1() throws IOException {
- ExecutionQueueImpl fsoup = new ExecutionQueueImpl(null);
- JacobVPU vpu = new JacobVPU();
- vpu.setContext(fsoup);
- vpu.inject(new CellTest1());
-
-
- while (vpu.execute()) {
- vpu.flush();
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- fsoup.write(bos);
- bos.close();
- System.err.println("CONTINUATION SIZE: " + bos.size());
+ public JacobCellTest(String testName) {
+ super(testName);
}
- vpu.dumpState();
- fsoup.dumpState(System.err);
- assertNotNull(_val);
- assertEquals("foo", _val);
- }
-
- @SuppressWarnings("serial")
-static class CellTest1 extends JacobRunnable {
- public void run() {
- CellChannel cellChannel = newChannel(CellChannel.class, "cell");
- ValChannel retChannel = newChannel(ValChannel.class, "val");
-
- instance(new CELL_<String>(cellChannel, "foo"));
- object(new ReceiveProcess<Val>(retChannel, new Val() {
- public void val(Object retVal) {
- _val = retVal;
- }
- }) {});
- cellChannel.read(retChannel);
+ public void testJacobCell1() throws IOException {
+ ExecutionQueueImpl fsoup = new ExecutionQueueImpl(null);
+ JacobVPU vpu = new JacobVPU();
+ vpu.setContext(fsoup);
+ vpu.inject(new CellTest1());
+
+ while (vpu.execute()) {
+ vpu.flush();
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ fsoup.write(bos);
+ bos.close();
+ System.err.println("CONTINUATION SIZE: " + bos.size());
+ }
+ vpu.dumpState();
+ fsoup.dumpState(System.err);
+ assertNotNull(_val);
+ assertEquals("foo", _val);
+ }
+
+ @SuppressWarnings("serial")
+ static class CellTest1 extends JacobRunnable {
+ public void run() {
+ Cell cell = newChannel(Cell.class, "cell");
+ Val ret = newChannel(Val.class, "val");
+
+ instance(new CELL_<String>(cell, "foo"));
+ object(new ReceiveProcess<Val>(ret, new Val() {
+ public void val(Object retVal) {
+ _val = retVal;
+ }
+ }) {});
+ cell.read(ret);
+ }
}
- }
}