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/22 23:26:10 UTC
svn commit: r1437219 - in /ode/trunk:
bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/
jacob/src/main/java/org/apache/ode/jacob/
jacob/src/main/java/org/apache/ode/jacob/vpu/
jacob/src/test/java/org/apache/ode/jacob/examples/cell/ jacob/src/test...
Author: hadrian
Date: Tue Jan 22 22:26:09 2013
New Revision: 1437219
URL: http://svn.apache.org/viewvc?rev=1437219&view=rev
Log:
ODE-987. Introduce default constructor for ReceiveProcess
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ORDEREDCOMPENSATOR.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/READWRITELOCK.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ProcessUtil.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ReceiveProcess.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.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/eratosthenes/Sieve.java
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/helloworld/HelloWorld.java
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/sequence/Sequence.java
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/synch/SynchPrinter.java
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java Tue Jan 22 22:26:09 2013
@@ -21,7 +21,6 @@ package org.apache.ode.bpel.runtime;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -47,7 +46,6 @@ import org.apache.ode.bpel.runtime.chann
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TimerResponse;
-import org.apache.ode.jacob.ChannelListener;
import org.apache.ode.jacob.CompositeProcess;
import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.Synch;
@@ -107,25 +105,25 @@ class ACTIVITYGUARD extends ACTIVITY {
dpe(_oactivity);
}
} else /* don't know all our links statuses */ {
- CompositeProcess mlset = compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ CompositeProcess mlset = compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 5094153128476008961L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
// Complete immediately, without faulting or registering any comps.
_self.parent.completed(null, CompensationHandler.emptySet());
// Dead-path activity
dpe(_oactivity);
}
- }) {
- private static final long serialVersionUID = 5094153128476008961L;
- });
+ }));
for (final OLink link : _oactivity.targetLinks) {
- mlset.or(new ReceiveProcess<LinkStatus>(_linkFrame.resolve(link).sub, new LinkStatus() {
+ mlset.or(new ReceiveProcess<LinkStatus>() {
+ private static final long serialVersionUID = 1024137371118887935L;
+ }.setChannel(_linkFrame.resolve(link).sub).setReceiver(new LinkStatus() {
public void linkStatus(boolean value) {
_linkVals.put(link, Boolean.valueOf(value));
instance(ACTIVITYGUARD.this);
}
- }) {
- private static final long serialVersionUID = 1024137371118887935L;
- });
+ }));
}
object(false, mlset);
@@ -200,7 +198,9 @@ class ACTIVITYGUARD extends ACTIVITY {
}
public void run() {
- object(new ReceiveProcess<ParentScope>(_in, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 2667359535900385952L;
+ }.setChannel(_in).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_self.parent.compensate(scope,ret);
instance(TCONDINTERCEPT.this);
@@ -274,7 +274,9 @@ class ACTIVITYGUARD extends ACTIVITY {
(failureHandling == null ? 0L : failureHandling.retryDelay * 1000));
final TimerResponse timerChannel = newChannel(TimerResponse.class);
getBpelRuntimeContext().registerTimer(timerChannel, future);
- object(false, new ReceiveProcess<TimerResponse>(timerChannel, new TimerResponse() {
+ object(false, new ReceiveProcess<TimerResponse>() {
+ private static final long serialVersionUID = -261911108068231376L;
+ }.setChannel(timerChannel).setReceiver(new TimerResponse() {
public void onTimeout() {
++_failure.retryCount;
startGuardedActivity();
@@ -282,9 +284,7 @@ class ACTIVITYGUARD extends ACTIVITY {
public void onCancel() {
requireRecovery();
}
- }) {
- private static final long serialVersionUID = -261911108068231376L;
- });
+ }));
}
private void requireRecovery() {
@@ -295,7 +295,9 @@ class ACTIVITYGUARD extends ACTIVITY {
getBpelRuntimeContext().registerActivityForRecovery(
recoveryChannel, _self.aId, _failure.reason, _failure.dateTime, _failure.data,
new String[] { "retry", "cancel", "fault" }, _failure.retryCount);
- object(false, compose(new ReceiveProcess<ActivityRecovery>(recoveryChannel, new ActivityRecovery() {
+ object(false, compose(new ReceiveProcess<ActivityRecovery>() {
+ private static final long serialVersionUID = 8397883882810521685L;
+ }.setChannel(recoveryChannel).setReceiver(new ActivityRecovery() {
public void retry() {
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Retrying activity " + _self.aId + " (user initiated)");
@@ -320,22 +322,18 @@ class ACTIVITYGUARD extends ACTIVITY {
faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, _failure.reason);
completed(faultData, CompensationHandler.emptySet());
}
- }){
- private static final long serialVersionUID = 8397883882810521685L;
- }).or(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 2148587381204858397L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Cancelling activity " + _self.aId + " (terminated by scope)");
getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
cancelled();
}
- }) {
- private static final long serialVersionUID = 2148587381204858397L;
- }));
+ })));
}
- }) {
- private static final long serialVersionUID = 2667359535900385952L;
- });
+ }));
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java Tue Jan 22 22:26:09 2013
@@ -40,12 +40,12 @@ class COMPENSATE extends ACTIVITY {
OScope scopeToCompensate = _ocompact.compensatedScope;
Synch sc = newChannel(Synch.class);
_self.parent.compensate(scopeToCompensate,sc);
- object(new ReceiveProcess<Synch>(sc, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = 3763991229748926216L;
+ }.setChannel(sc).setReceiver(new Synch() {
public void ret() {
_self.parent.completed(null, CompensationHandler.emptySet());
- }
- }) {
- private static final long serialVersionUID = 3763991229748926216L;
- });
+ }
+ }));
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java Tue Jan 22 22:26:09 2013
@@ -47,7 +47,9 @@ class COMPENSATIONHANDLER_ extends BpelJ
public void run() {
sendEvent(new CompensationHandlerRegistered());
- object(new ReceiveProcess<Compensation>(_self.compChannel, new Compensation() {
+ object(new ReceiveProcess<Compensation>() {
+ private static final long serialVersionUID = -477602498730810094L;
+ }.setChannel(_self.compChannel).setReceiver(new Compensation() {
public void forget() {
// Tell all our completed children to forget.
for (Iterator<CompensationHandler> i = _completedChildren.iterator(); i.hasNext(); )
@@ -72,7 +74,9 @@ class COMPENSATIONHANDLER_ extends BpelJ
// Create the compensation handler scope.
instance(new SCOPE(ai,compHandlerScopeFrame, new LinkFrame(null)));
- object(new ReceiveProcess<ParentScope>(ai.parent, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 8044120498580711546L;
+ }.setChannel(ai.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
throw new AssertionError("Unexpected.");
}
@@ -91,13 +95,9 @@ class COMPENSATIONHANDLER_ extends BpelJ
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = 8044120498580711546L;
- });
+ }));
}
- }) {
- private static final long serialVersionUID = -477602498730810094L;
- });
+ }));
}
private void sendEvent(ScopeEvent event) {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java Tue Jan 22 22:26:09 2013
@@ -34,7 +34,6 @@ import org.apache.ode.bpel.runtime.chann
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TimerResponse;
-import org.apache.ode.jacob.ChannelListener;
import org.apache.ode.jacob.CompositeProcess;
import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.Synch;
@@ -131,19 +130,19 @@ class EH_ALARM extends BpelJacobRunnable
public void run() {
Calendar now = Calendar.getInstance();
- CompositeProcess listeners = compose(new ReceiveProcess<EventHandlerControl>(_cc, new EventHandlerControl() {
+ CompositeProcess listeners = compose(new ReceiveProcess<EventHandlerControl>() {
+ private static final long serialVersionUID = -7750428941445331236L;
+ }.setChannel(_cc).setReceiver(new EventHandlerControl() {
public void stop() {
_psc.completed(null, _comps);
}
- }){
- private static final long serialVersionUID = -7750428941445331236L;
- }).or(new ReceiveProcess<Termination>(_tc, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 6100105997983514609L;
+ }.setChannel(_tc).setReceiver(new Termination() {
public void terminate() {
_psc.completed(null, _comps);
}
- }) {
- private static final long serialVersionUID = 6100105997983514609L;
- });
+ }));
if (_alarm == null) {
object(false, listeners);
@@ -151,7 +150,9 @@ class EH_ALARM extends BpelJacobRunnable
TimerResponse trc = newChannel(TimerResponse.class);
getBpelRuntimeContext().registerTimer(trc,_alarm.getTime());
- listeners.or(new ReceiveProcess<TimerResponse>(trc, new TimerResponse(){
+ listeners.or(new ReceiveProcess<TimerResponse>() {
+ private static final long serialVersionUID = 1110683632756756017L;
+ }.setChannel(trc).setReceiver(new TimerResponse(){
public void onTimeout() {
// This is what we are waiting for, fire the activity
instance(new FIRE());
@@ -160,9 +161,7 @@ class EH_ALARM extends BpelJacobRunnable
public void onCancel() {
_psc.completed(null, _comps);
}
- }) {
- private static final long serialVersionUID = 1110683632756756017L;
- });
+ }));
object(false, listeners);
} else /* now is later then alarm time */ {
// If the alarm has passed we fire the nested activity
@@ -207,7 +206,9 @@ class EH_ALARM extends BpelJacobRunnable
}
public void run() {
- object(false, compose(new ReceiveProcess<ParentScope>(_activity.parent, new ParentScope() {
+ object(false, compose(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -3357030137175178040L;
+ }.setChannel(_activity.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_psc.compensate(scope,ret);
instance(ACTIVE.this);
@@ -239,24 +240,22 @@ class EH_ALARM extends BpelJacobRunnable
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }){
- private static final long serialVersionUID = -3357030137175178040L;
- }).or(new ReceiveProcess<EventHandlerControl>(_cc, new EventHandlerControl() {
+ })).or(new ReceiveProcess<EventHandlerControl>() {
+ private static final long serialVersionUID = -3873619538789039424L;
+ }.setChannel(_cc).setReceiver(new EventHandlerControl() {
public void stop() {
_stopped = true;
instance(ACTIVE.this);
}
- }){
- private static final long serialVersionUID = -3873619538789039424L;
- }).or(new ReceiveProcess<Termination>(_tc, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = -4566956567870652885L;
+ }.setChannel(_tc).setReceiver(new Termination() {
public void terminate() {
replication(_activity.self).terminate();
_stopped = true;
instance(ACTIVE.this);
}
- }){
- private static final long serialVersionUID = -4566956567870652885L;
- }));
+ })));
}
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java Tue Jan 22 22:26:09 2013
@@ -162,7 +162,9 @@ class EH_EVENT extends BpelJacobRunnable
CompositeProcess mlset = ProcessUtil.compose(null);
if (!_terminated) {
- mlset.or(new ReceiveProcess<Termination>(_tc, new Termination() {
+ mlset.or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 7666910462948788042L;
+ }.setChannel(_tc).setReceiver(new Termination() {
public void terminate() {
terminateActive();
_terminated = true;
@@ -170,26 +172,26 @@ class EH_EVENT extends BpelJacobRunnable
getBpelRuntimeContext().cancel(_pickResponseChannel);
instance(WAITING.this);
}
- }) {
- private static final long serialVersionUID = 7666910462948788042L;
- });
+ }));
}
if (!_stopped) {
- mlset.or(new ReceiveProcess<EventHandlerControl>(_ehc, new EventHandlerControl() {
+ mlset.or(new ReceiveProcess<EventHandlerControl>() {
+ private static final long serialVersionUID = -1050788954724647970L;
+ }.setChannel(_ehc).setReceiver(new EventHandlerControl() {
public void stop() {
_stopped = true;
if (_pickResponseChannel != null)
getBpelRuntimeContext().cancel(_pickResponseChannel);
instance(WAITING.this);
}
- }) {
- private static final long serialVersionUID = -1050788954724647970L;
- });
+ }));
}
for (final ActivityInfo ai : _active) {
- mlset.or(new ReceiveProcess<ParentScope>(ai.parent, new ParentScope() {
+ mlset.or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 5341207762415360982L;
+ }.setChannel(ai.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_psc.compensate(scope, ret);
instance(WAITING.this);
@@ -211,13 +213,13 @@ class EH_EVENT extends BpelJacobRunnable
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = 5341207762415360982L;
- });
+ }));
}
if (_pickResponseChannel != null)
- mlset.or(new ReceiveProcess<PickResponse>(_pickResponseChannel, new PickResponse() {
+ mlset.or(new ReceiveProcess<PickResponse>() {
+ private static final long serialVersionUID = -4929999153478677288L;
+ }.setChannel(_pickResponseChannel).setReceiver(new PickResponse() {
public void onRequestRcvd(int selectorIdx, String mexId) {
// The receipt of the message causes a new scope to be created:
ScopeFrame ehScopeFrame = new ScopeFrame(_oevent,
@@ -325,9 +327,7 @@ class EH_EVENT extends BpelJacobRunnable
public void onCancel() {
instance(new WAITING(null));
}
- }) {
- private static final long serialVersionUID = -4929999153478677288L;
- });
+ }));
object(false, mlset);
} else /* Nothing more to do. */ {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java Tue Jan 22 22:26:09 2013
@@ -79,19 +79,21 @@ class FLOW extends ACTIVITY {
public void run() {
Iterator<ChildInfo> active = active();
if (active.hasNext()) {
- CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 2554750258974084466L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
for (Iterator<ChildInfo> i = active(); i.hasNext(); )
replication(i.next().activity.self).terminate();
instance(ACTIVE.this);
}
- }) {
- private static final long serialVersionUID = 2554750258974084466L;
- });
+ }));
for (;active.hasNext();) {
final ChildInfo child = active.next();
- mlSet.or(new ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
+ mlSet.or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -8027205709169238172L;
+ }.setChannel(child.activity.parent).setReceiver(new ParentScope() {
public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
child.completed = true;
_compensations.addAll(compensations);
@@ -113,9 +115,7 @@ class FLOW extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = -8027205709169238172L;
- });
+ }));
}
object(false, mlSet);
} else /** No More active children. */ {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java Tue Jan 22 22:26:09 2013
@@ -111,7 +111,9 @@ public class FOREACH extends ACTIVITY {
Iterator<ChildInfo> active = active();
// Continuing as long as a child is active
if (active().hasNext()) {
- CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 2554750257484084466L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
// Terminating all children before sepuku
for (Iterator<ChildInfo> i = active(); i.hasNext(); )
@@ -119,13 +121,13 @@ public class FOREACH extends ACTIVITY {
_terminateRequested = true;
instance(ACTIVE.this);
}
- }) {
- private static final long serialVersionUID = 2554750257484084466L;
- });
+ }));
for (;active.hasNext();) {
// Checking out our children
final ChildInfo child = active.next();
- mlSet.or(new ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
+ mlSet.or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -8027205709961438172L;
+ }.setChannel(child.activity.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
// Forward compensation to parent
_self.parent.compensate(scope, ret);
@@ -158,9 +160,7 @@ public class FOREACH extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = -8027205709961438172L;
- });
+ }));
}
object(false, mlSet);
} else {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java Tue Jan 22 22:26:09 2013
@@ -99,7 +99,9 @@ public class INVOKE extends ACTIVITY {
_scopeFrame.resolve(_oinvoke.partnerLink), _oinvoke.operation,
outboundMsg, invokeResponseChannel);
- object(false, compose(new ReceiveProcess<InvokeResponse>(invokeResponseChannel, new InvokeResponse() {
+ object(false, compose(new ReceiveProcess<InvokeResponse>() {
+ private static final long serialVersionUID = 4496880438819196765L;
+ }.setChannel(invokeResponseChannel).setReceiver(new InvokeResponse() {
public void onResponse() {
// we don't have to write variable data -> this already
// happened in the nativeAPI impl
@@ -191,15 +193,13 @@ public class INVOKE extends ACTIVITY {
getBpelRuntimeContext().releasePartnerMex(mexId, false);
}
- }){
- private static final long serialVersionUID = 4496880438819196765L;
- }).or(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 4219496341785922396L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
_self.parent.completed(null, CompensationHandler.emptySet());
}
- }) {
- private static final long serialVersionUID = 4219496341785922396L;
- }));
+ })));
}
} catch (FaultException fault) {
__log.error(fault);
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ORDEREDCOMPENSATOR.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ORDEREDCOMPENSATOR.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ORDEREDCOMPENSATOR.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ORDEREDCOMPENSATOR.java Tue Jan 22 22:26:09 2013
@@ -49,13 +49,13 @@ class ORDEREDCOMPENSATOR extends BpelJac
Synch r = newChannel(Synch.class);
CompensationHandler cdata = _compensations.remove(0);
cdata.compChannel.compensate(r);
- object(new ReceiveProcess<Synch>(r, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = 7173916663479205420L;
+ }.setChannel(r).setReceiver(new Synch() {
public void ret() {
instance(ORDEREDCOMPENSATOR.this);
}
- }) {
- private static final long serialVersionUID = 7173916663479205420L;
- });
+ }));
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java Tue Jan 22 22:26:09 2013
@@ -282,7 +282,9 @@ class PICK extends ACTIVITY {
}
public void run() {
- object(false, compose(new ReceiveProcess<PickResponse>(_pickResponseChannel, new PickResponse() {
+ object(false, compose(new ReceiveProcess<PickResponse>() {
+ private static final long serialVersionUID = -8237296827418738011L;
+ }.setChannel(_pickResponseChannel).setReceiver(new PickResponse() {
public void onRequestRcvd(int selectorIdx, String mexId) {
OPickReceive.OnMessage onMessage = _opick.onMessages.get(selectorIdx);
@@ -374,16 +376,14 @@ class PICK extends ACTIVITY {
_self.parent.completed(null, CompensationHandler.emptySet());
}
- }){
- private static final long serialVersionUID = -8237296827418738011L;
- }).or(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 4399496341785922396L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
getBpelRuntimeContext().cancel(_pickResponseChannel);
instance(WAITING.this);
}
- }) {
- private static final long serialVersionUID = 4399496341785922396L;
- }));
+ })));
}
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java Tue Jan 22 22:26:09 2013
@@ -59,7 +59,9 @@ public class PROCESS extends BpelJacobRu
ScopeFrame processFrame = new ScopeFrame(_oprocess.procesScope, scopeInstanceId, null, null,_globals);
instance(new SCOPE(child, processFrame, new LinkFrame(null)));
- object(new ReceiveProcess<ParentScope>(child.parent, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -8564969578471906493L;
+ }.setChannel(child.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
assert false;
}
@@ -81,9 +83,7 @@ public class PROCESS extends BpelJacobRu
FaultData faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _oprocess, reason);
this.completed(faultData, CompensationHandler.emptySet());
}
- }) {
- private static final long serialVersionUID = -8564969578471906493L;
- });
+ }));
}
private void createGlobals() {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/READWRITELOCK.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/READWRITELOCK.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/READWRITELOCK.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/READWRITELOCK.java Tue Jan 22 22:26:09 2013
@@ -55,7 +55,9 @@ public class READWRITELOCK extends Jacob
@Override
public void run() {
- object(new ReceiveProcess<ReadWriteLock>(_self, new ReadWriteLock() {
+ object(new ReceiveProcess<ReadWriteLock>() {
+ private static final long serialVersionUID = -8644268413754259515L;
+ }.setChannel(_self).setReceiver(new ReadWriteLock() {
public void readLock(Synch s) {
switch (_status) {
case UNLOCKED:
@@ -119,9 +121,7 @@ public class READWRITELOCK extends Jacob
instance(READWRITELOCK.this);
}
- }) {
- private static final long serialVersionUID = -8644268413754259515L;
- });
+ }));
}
private static class Waiter {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java Tue Jan 22 22:26:09 2013
@@ -97,15 +97,17 @@ public class REPEATUNTIL extends ACTIVIT
}
public void run() {
- object(false, compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ object(false, compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = -5471984635653784051L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
_terminated = true;
replication(_child.self).terminate();
instance(WAITER.this);
}
- }) {
- private static final long serialVersionUID = -5471984635653784051L;
- }).or(new ReceiveProcess<ParentScope>(_child.parent, new ParentScope() {
+ })).or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 3907167240907524405L;
+ }.setChannel(_child.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_self.parent.compensate(scope,ret);
instance(WAITER.this);
@@ -135,9 +137,7 @@ public class REPEATUNTIL extends ACTIVIT
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = 3907167240907524405L;
- }));
+ })));
}
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java Tue Jan 22 22:26:09 2013
@@ -140,7 +140,9 @@ class SCOPE extends ACTIVITY {
public void run() {
if (_child != null || !_eventHandlers.isEmpty()) {
- CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ CompositeProcess mlSet = ProcessUtil.compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = 1913414844895865116L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
_terminated = true;
@@ -155,13 +157,13 @@ class SCOPE extends ACTIVITY {
instance(ACTIVE.this);
}
- }) {
- private static final long serialVersionUID = 1913414844895865116L;
- });
+ }));
// Handle messages from the child if it is still alive
if (_child != null) {
- mlSet.or(new ReceiveProcess<ParentScope>(_child.parent, new ParentScope() {
+ mlSet.or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -6934246487304813033L;
+ }.setChannel(_child.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
// If this scope does not have available compensations, defer to
// parent scope, otherwise do compensation.
@@ -202,13 +204,11 @@ class SCOPE extends ACTIVITY {
}
public void failure(String reason, Element data) {
- completed(createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, null),
- CompensationHandler.emptySet());
+ completed(createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, null),
+ CompensationHandler.emptySet());
}
- }) {
- private static final long serialVersionUID = -6934246487304813033L;
- });
+ }) );
}
// Similarly, handle messages from the event handler, if one exists
@@ -216,7 +216,9 @@ class SCOPE extends ACTIVITY {
for (Iterator<EventHandlerInfo> i = _eventHandlers.iterator();i.hasNext();) {
final EventHandlerInfo ehi = i.next();
- mlSet.or(new ReceiveProcess<ParentScope>(ehi.psc, new ParentScope() {
+ mlSet.or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -4694721357537858221L;
+ }.setChannel(ehi.psc).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
// ACTIVE scopes do not compensate, send request up to parent.
_self.parent.compensate(scope, ret);
@@ -246,9 +248,7 @@ class SCOPE extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = -4694721357537858221L;
- });
+ }));
}
object(false, mlSet);
} else /* nothing to wait for... */ {
@@ -291,7 +291,9 @@ class SCOPE extends ACTIVITY {
// Create the temination handler scope.
instance(new SCOPE(terminationHandlerActivity,terminationHandlerScopeFrame, SCOPE.this._linkFrame));
- object(new ReceiveProcess<ParentScope>(terminationHandlerActivity.parent, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -6009078124717125270L;
+ }.setChannel(terminationHandlerActivity.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
// This should never happen.
throw new AssertionError("received compensate request!");
@@ -309,9 +311,7 @@ class SCOPE extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = -6009078124717125270L;
- });
+ }));
} else {
_self.parent.completed(null,_compensations);
}
@@ -370,7 +370,9 @@ class SCOPE extends ACTIVITY {
// Create the fault handler scope.
instance(new SCOPE(faultHandlerActivity,faultHandlerScopeFrame, SCOPE.this._linkFrame));
- object(new ReceiveProcess<ParentScope>(faultHandlerActivity.parent, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = -6009078124717125270L;
+ }.setChannel(faultHandlerActivity.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
// This should never happen.
throw new AssertionError("received compensate request!");
@@ -387,9 +389,7 @@ class SCOPE extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = -6009078124717125270L;
- });
+ }));
}
} else /* completed ok */ {
sendEvent(new ScopeCompletionEvent());
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=1437219&r1=1437218&r2=1437219&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 Tue Jan 22 22:26:09 2013
@@ -150,7 +150,9 @@ public class SCOPEACT extends ACTIVITY {
CompositeProcess mlset = ProcessUtil.compose(null);
if (_status == null)
- mlset.or(new ReceiveProcess<Val>(_self, new Val() {
+ mlset.or(new ReceiveProcess<Val>() {
+ private static final long serialVersionUID = 5029554538593371750L;
+ }.setChannel(_self).setReceiver(new Val() {
/** Our owner will notify us when it becomes clear what to do with the links. */
public void val(Object retVal) {
if (__log.isDebugEnabled()) {
@@ -162,31 +164,29 @@ public class SCOPEACT extends ACTIVITY {
_linkFrame.resolve(available).pub.linkStatus(_statuses.get(available) && _status);
// Check if we still need to wait around for more links.
- if (!isDone())
+ if (!isDone()) {
instance(LINKSTATUSINTERCEPTOR.this);
-
+ }
}
- }) {
- private static final long serialVersionUID = 5029554538593371750L;
- });
+ }));
for (final Map.Entry<OLink, LinkInfo> m : _interceptedChannels.links.entrySet()) {
if (_statuses.containsKey(m.getKey()))
continue;
- mlset.or(new ReceiveProcess<LinkStatus>(m.getValue().pub, new LinkStatus() {
+ mlset.or(new ReceiveProcess<LinkStatus>() {
+ private static final long serialVersionUID = 1568144473514091593L;
+ }.setChannel(m.getValue().pub).setReceiver(new LinkStatus() {
public void linkStatus(boolean value) {
_statuses.put(m.getKey(), value);
- if (_status != null)
+ if (_status != null) {
_linkFrame.resolve(m.getKey()).pub.linkStatus(value && _status);
-
- if (!isDone())
+ }
+ if (!isDone()) {
instance(LINKSTATUSINTERCEPTOR.this);
-
+ }
}
- }) {
- private static final long serialVersionUID = 1568144473514091593L;
- });
+ }));
}
object(false, mlset);
@@ -256,15 +256,15 @@ public class SCOPEACT extends ACTIVITY {
else
il.lockChannel.readLock(_synchChannel);
- object(new ReceiveProcess<Synch>(_synchChannel, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = 2857261074409098274L;
+ }.setChannel(_synchChannel).setReceiver(new Synch() {
public void ret() {
__log.debug("ISOLATIONGUARD: got lock: " + _locksNeeded.get(0));
_locksAcquired.add(_locksNeeded.remove(0));
instance(ISOLATEDGUARD.this);
}
- }) {
- private static final long serialVersionUID = 2857261074409098274L;
- });
+ }));
}
}
@@ -303,7 +303,9 @@ public class SCOPEACT extends ACTIVITY {
public void run() {
__log.debug("running UNLOCKER");
- object(new ReceiveProcess<ParentScope>(_self, new ParentScope() {
+ object(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 1L;
+ }.setChannel(_self).setReceiver(new ParentScope() {
public void cancelled() {
_parent.cancelled();
unlockAll();
@@ -330,9 +332,7 @@ public class SCOPEACT extends ACTIVITY {
unlockAll();
// no more listening
}
- }) {
- private static final long serialVersionUID = 1L;
- });
+ }));
}
/**
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java Tue Jan 22 22:26:09 2013
@@ -78,7 +78,9 @@ class SEQUENCE extends ACTIVITY {
}
public void run() {
- object(false, compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ object(false, compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = -2680515407515637639L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
replication(_child.self).terminate();
@@ -90,9 +92,9 @@ class SEQUENCE extends ACTIVITY {
_terminateRequested = true;
instance(ACTIVE.this);
}
- }) {
- private static final long serialVersionUID = -2680515407515637639L;
- }).or(new ReceiveProcess<ParentScope>(_child.parent, new ParentScope() {
+ })).or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 7195562310281985971L;
+ }.setChannel(_child.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_self.parent.compensate(scope,ret);
instance(ACTIVE.this);
@@ -113,9 +115,7 @@ class SEQUENCE extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = 7195562310281985971L;
- }));
+ })));
}
private void deadPathRemaining(List<OActivity> remaining) {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java Tue Jan 22 22:26:09 2013
@@ -68,7 +68,9 @@ class WAIT extends ACTIVITY {
final TimerResponse timerChannel = newChannel(TimerResponse.class);
getBpelRuntimeContext().registerTimer(timerChannel, dueDate);
- object(false, compose(new ReceiveProcess<TimerResponse>(timerChannel, new TimerResponse() {
+ object(false, compose(new ReceiveProcess<TimerResponse>() {
+ private static final long serialVersionUID = 3120518305645437327L;
+ }.setChannel(timerChannel).setReceiver(new TimerResponse() {
public void onTimeout() {
_self.parent.completed(null, CompensationHandler.emptySet());
}
@@ -76,12 +78,14 @@ class WAIT extends ACTIVITY {
public void onCancel() {
_self.parent.completed(null, CompensationHandler.emptySet());
}
- }) {
- private static final long serialVersionUID = 3120518305645437327L;
- }).or(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ })).or(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = -2791243270691333946L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
_self.parent.completed(null, CompensationHandler.emptySet());
- object(new ReceiveProcess<TimerResponse>(timerChannel, new TimerResponse() {
+ object(new ReceiveProcess<TimerResponse>() {
+ private static final long serialVersionUID = 677746737897792929L;
+ }.setChannel(timerChannel).setReceiver(new TimerResponse() {
public void onTimeout() {
//ignore
}
@@ -89,13 +93,9 @@ class WAIT extends ACTIVITY {
public void onCancel() {
//ingore
}
- }) {
- private static final long serialVersionUID = 677746737897792929L;
- });
+ }));
}
- }) {
- private static final long serialVersionUID = -2791243270691333946L;
- }));
+ })));
} else {
_self.parent.completed(null, CompensationHandler.emptySet());
}
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java Tue Jan 22 22:26:09 2013
@@ -115,15 +115,17 @@ class WHILE extends ACTIVITY {
}
public void run() {
- object(false, compose(new ReceiveProcess<Termination>(_self.self, new Termination() {
+ object(false, compose(new ReceiveProcess<Termination>() {
+ private static final long serialVersionUID = -5471984635653784051L;
+ }.setChannel(_self.self).setReceiver(new Termination() {
public void terminate() {
_terminated = true;
replication(_child.self).terminate();
instance(WAITER.this);
}
- }) {
- private static final long serialVersionUID = -5471984635653784051L;
- }).or(new ReceiveProcess<ParentScope>(_child.parent, new ParentScope() {
+ })).or(new ReceiveProcess<ParentScope>() {
+ private static final long serialVersionUID = 3907167240907524405L;
+ }.setChannel(_child.parent).setReceiver(new ParentScope() {
public void compensate(OScope scope, Synch ret) {
_self.parent.compensate(scope,ret);
instance(WAITER.this);
@@ -139,9 +141,7 @@ class WHILE extends ACTIVITY {
public void cancelled() { completed(null, CompensationHandler.emptySet()); }
public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
- }) {
- private static final long serialVersionUID = 3907167240907524405L;
- }));
+ })));
}
}
}
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ProcessUtil.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ProcessUtil.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ProcessUtil.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ProcessUtil.java Tue Jan 22 22:26:09 2013
@@ -47,8 +47,6 @@ public final class ProcessUtil {
// TODO: NOTE: this *only* works when the listnere doesn't need to be Serialiazble really
// because we cannot declare a staic serialVersionUID like this
// once we fix serialization, this can be simplified significantly via a dsl
- return new ReceiveProcess<T>(proxy, listener) {
- // private static final long serialVersionUID = 1024137371118887935L;
- };
+ return new ReceiveProcess<T>() {}.setChannel(proxy).setReceiver(listener);
}
}
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ReceiveProcess.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ReceiveProcess.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ReceiveProcess.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ReceiveProcess.java Tue Jan 22 22:26:09 2013
@@ -28,11 +28,12 @@ import java.util.Set;
public abstract class ReceiveProcess<T extends Channel> extends ChannelListener {
private transient Set<Method> _implementedMethods;
private transient Channel channel;
- private T receiver;
+ private Channel receiver;
+ public ReceiveProcess() {
+ }
+
protected ReceiveProcess(T channel, T receiver) {
- assert getClass().getSuperclass().getSuperclass() == ChannelListener.class :
- "Inheritance in ChannelListener classes not allowed!";
if (channel == null) {
throw new IllegalArgumentException("Null channel!");
}
@@ -40,16 +41,22 @@ public abstract class ReceiveProcess<T e
this.receiver = receiver;
}
- public T receiver() {
- return receiver;
- }
-
public Channel getChannel() {
return channel;
}
- public void setChannel(Channel channel) {
+ public ReceiveProcess<T> setChannel(Channel channel) {
this.channel = channel;
+ return this;
+ }
+
+ public Channel getReceiver() {
+ return receiver;
+ }
+
+ public ReceiveProcess<T> setReceiver(Channel receiver) {
+ this.receiver = receiver;
+ return this;
}
public Set<Method> getImplementedMethods() {
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java Tue Jan 22 22:26:09 2013
@@ -406,7 +406,7 @@ public final class JacobVPU {
long ctime = System.currentTimeMillis();
try {
_method.invoke(_methodBody instanceof ReceiveProcess ?
- ((ReceiveProcess<?>)_methodBody).receiver() : _methodBody, args);
+ ((ReceiveProcess<?>)_methodBody).getReceiver() : _methodBody, args);
if (synchChannel != null) {
synchChannel.ret();
}
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=1437219&r1=1437218&r2=1437219&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 Tue Jan 22 22:26:09 2013
@@ -44,7 +44,9 @@ public class CELL_<T> extends JacobRunna
public void run() {
// INSTANTIATION{Cell(run,val)}
// ==> run ? [ read(r)={...} & write(newVal)={...} ]
- object(new ReceiveProcess<Cell>(_self, new Cell() {
+ object(new ReceiveProcess<Cell>() {
+ private static final long serialVersionUID = 8883128084307471572L;
+ }.setChannel(_self).setReceiver(new Cell() {
public void read(Val r) {
// COMMUNICATION{x & [read... & ... ] | x ! read} ==> Cell(run, val) ...
instance(new CELL_<T>(_self, _val));
@@ -60,9 +62,7 @@ public class CELL_<T> extends JacobRunna
// COMMUNICATION{x & [... & write...] ==> Cell(run, newVal)
instance(new CELL_(_self, newVal));
}
- }) {
- private static final long serialVersionUID = 8883128084307471572L;
- });
+ }));
}
public String toString() {
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/eratosthenes/Sieve.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/eratosthenes/Sieve.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/eratosthenes/Sieve.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/eratosthenes/Sieve.java Tue Jan 22 22:26:09 2013
@@ -71,13 +71,13 @@ public class Sieve extends JacobRunnable
public void run() {
Synch ret = newChannel(Synch.class);
- object(new ReceiveProcess<Synch>(ret, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = -4336285925619915276L;
+ }.setChannel(ret).setReceiver(new Synch() {
public void ret() {
instance(new Counter(_out, _n+1));
}
- }) {
- private static final long serialVersionUID = -4336285925619915276L;
- });
+ }));
_out.val(_n, ret);
}
}
@@ -104,24 +104,24 @@ public class Sieve extends JacobRunnable
}
public void run() {
- object(new ReceiveProcess<NaturalNumberStream>(_in, new NaturalNumberStream() {
+ object(new ReceiveProcess<NaturalNumberStream>() {
+ private static final long serialVersionUID = -2145752474431263689L;
+ }.setChannel(_in).setReceiver(new NaturalNumberStream() {
public void val(final int n, final Synch ret) {
Synch r = newChannel(Synch.class);
- object(new ReceiveProcess<Synch>(r, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = -3009595654233593893L;
+ }.setChannel(r).setReceiver(new Synch() {
public void ret() {
NaturalNumberStream x = newChannel(NaturalNumberStream.class);
instance(new PrimeFilter(n, _in, x));
instance(new Head(x, _primes));
ret.ret();
}
- }) {
- private static final long serialVersionUID = -3009595654233593893L;
- });
+ }));
_primes.val(n, r);
}
- }) {
- private static final long serialVersionUID = -2145752474431263689L;
- });
+ }));
}
}
@@ -133,16 +133,16 @@ public class Sieve extends JacobRunnable
_in = in;
}
public void run() {
- object(true, new ReceiveProcess<NaturalNumberStream>(_in, new NaturalNumberStream(){
+ object(true, new ReceiveProcess<NaturalNumberStream>() {
+ private static final long serialVersionUID = 7671019806323866866L;
+ }.setChannel(_in).setReceiver(new NaturalNumberStream(){
public void val(int n, Synch ret) {
_cnt ++;
_last = n;
System.out.println("PRIME: " + n);
ret.ret();
}
- }) {
- private static final long serialVersionUID = 7671019806323866866L;
- });
+ }));
}
}
@@ -167,25 +167,25 @@ public class Sieve extends JacobRunnable
_out = out;
}
public void run() {
- object(true, new ReceiveProcess<NaturalNumberStream>(_in, new NaturalNumberStream() {
+ object(true, new ReceiveProcess<NaturalNumberStream>() {
+ private static final long serialVersionUID = 2523405590764193613L;
+ }.setChannel(_in).setReceiver(new NaturalNumberStream() {
public void val(int n, final Synch ret) {
if (n % _prime != 0) {
Synch r = newChannel(Synch.class);
- object(new ReceiveProcess<Synch>(r, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = 2523405590764193613L;
+ }.setChannel(r).setReceiver(new Synch() {
public void ret() {
ret.ret();
}
- }) {
- private static final long serialVersionUID = 2523405590764193613L;
- });
+ }));
_out.val(n, r);
} else {
ret.ret();
}
}
- }) {
- private static final long serialVersionUID = 6625386475773075604L;
- });
+ }));
}
}
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/helloworld/HelloWorld.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/helloworld/HelloWorld.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/helloworld/HelloWorld.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/helloworld/HelloWorld.java Tue Jan 22 22:26:09 2013
@@ -48,15 +48,15 @@ public class HelloWorld extends JacobRun
}
public void run() {
- object(true, new ReceiveProcess<Callback<String, Synch>>(_in, new Callback<String, Synch>(){
+ object(true, new ReceiveProcess<Callback<String, Synch>>() {
+ private static final long serialVersionUID = 1L;
+ }.setChannel(_in).setReceiver(new Callback<String, Synch>(){
@Override
public void invoke(String value, Synch callback) {
System.out.println(value);
callback.ret();
}
- }) {
- private static final long serialVersionUID = 1L;
- });
+ }));
}
}
@@ -71,19 +71,17 @@ public class HelloWorld extends JacobRun
public void run() {
Synch callback = newChannel(Synch.class, "callback channel to ACK " + str);
- object(new ReceiveProcess<Synch>(callback, new Synch() {
-
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = 1L;
+ }.setChannel(callback).setReceiver(new Synch() {
@Override
public void ret() {
System.out.println(str + " ACKed");
}
- }) {
- private static final long serialVersionUID = 1L;
- });
+ }));
to.invoke(str, callback);
}
}
-
static class PrinterProcess extends JacobRunnable {
private Val _in;
@@ -92,13 +90,13 @@ public class HelloWorld extends JacobRun
}
public void run() {
- object(true, new ReceiveProcess<Val>(_in, new Val(){
+ object(true, new ReceiveProcess<Val>() {
+ private static final long serialVersionUID = 1L;
+ }.setChannel(_in).setReceiver(new Val(){
public void val(Object o) {
System.out.println(o);
}
- }) {
- private static final long serialVersionUID = 1L;
- });
+ }));
}
}
@@ -125,13 +123,13 @@ public class HelloWorld extends JacobRun
}
public void run() {
- object(true, new ReceiveProcess<Val>(in, new Val(){
+ object(true, new ReceiveProcess<Val>() {
+ private static final long serialVersionUID = 1L;
+ }.setChannel(in).setReceiver(new Val(){
public void val(Object o) {
out.val(o);
}
- }) {
- private static final long serialVersionUID = 1L;
- });
+ }));
}
}
Modified: ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/sequence/Sequence.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/sequence/Sequence.java?rev=1437219&r1=1437218&r2=1437219&view=diff
==============================================================================
--- ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/sequence/Sequence.java (original)
+++ ode/trunk/jacob/src/test/java/org/apache/ode/jacob/examples/sequence/Sequence.java Tue Jan 22 22:26:09 2013
@@ -53,14 +53,14 @@ public abstract class Sequence extends J
}
} else {
Synch r = newChannel(Synch.class);
- object(new ReceiveProcess<Synch>(r, new Synch() {
+ object(new ReceiveProcess<Synch>() {
+ private static final long serialVersionUID = -6999108928780639603L;
+ }.setChannel(r).setReceiver(new Synch() {
public void ret() {
++_current;
instance(Sequence.this);
}
- }) {
- private static final long serialVersionUID = -6999108928780639603L;
- });
+ }));
instance(doStep(_current, r));
}
}
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=1437219&r1=1437218&r2=1437219&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 Tue Jan 22 22:26:09 2013
@@ -44,14 +44,14 @@ public class SynchPrinter {
@SuppressWarnings("serial")
public void run() {
- object(true, new ReceiveProcess<SynchPrint>(_self, new SynchPrint() {
+ object(true, new ReceiveProcess<SynchPrint>() {
+ private static final long serialVersionUID = -1990741944766989782L;
+ }.setChannel(_self).setReceiver(new SynchPrint() {
public Synch print(String msg) {
System.out.println(msg);
return null; // Synch channel automatically created by JacobVPU
}
- }) {
- private static final long serialVersionUID = -1990741944766989782L;
- });
+ }));
}
}