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/15 18:10:19 UTC
svn commit: r1433527 -
/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/
Author: hadrian
Date: Tue Jan 15 17:10:18 2013
New Revision: 1433527
URL: http://svn.apache.org/viewvc?rev=1433527&view=rev
Log:
ODE-979. Finish removing dependencies on generated ChannelListeners
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/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/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/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
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,6 +18,14 @@
*/
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;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
@@ -29,30 +37,25 @@ import org.apache.ode.bpel.evt.ActivityR
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.o.OFailureHandling;
import org.apache.ode.bpel.o.OInvoke;
import org.apache.ode.bpel.o.OLink;
import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OFailureHandling;
+import org.apache.ode.bpel.runtime.channels.ActivityRecovery;
+import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannel;
import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.channels.LinkStatusChannelListener;
+import org.apache.ode.bpel.runtime.channels.LinkStatus;
+import org.apache.ode.bpel.runtime.channels.LinkStatusChannel;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannel;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
+import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.bpel.runtime.channels.TimerResponse;
import org.apache.ode.bpel.runtime.channels.TimerResponseChannel;
-import org.apache.ode.bpel.runtime.channels.TimerResponseChannelListener;
import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
-
import org.w3c.dom.Element;
-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;
class ACTIVITYGUARD extends ACTIVITY {
private static final long serialVersionUID = 1L;
@@ -106,24 +109,24 @@ class ACTIVITYGUARD extends ACTIVITY {
}
} else /* don't know all our links statuses */ {
Set<ChannelListener<?>> mlset = new HashSet<ChannelListener<?>>();
- mlset.add(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 5094153128476008961L;
-
+ mlset.add(new ReceiveProcess<TerminationChannel, Termination>(_self.self, 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.add(new LinkStatusChannelListener(_linkFrame.resolve(link).sub) {
- private static final long serialVersionUID = 1024137371118887935L;
-
+ mlset.add(new ReceiveProcess<LinkStatusChannel, LinkStatus>(_linkFrame.resolve(link).sub, new LinkStatus() {
public void linkStatus(boolean value) {
_linkVals.put(link, Boolean.valueOf(value));
instance(ACTIVITYGUARD.this);
}
+ }) {
+ private static final long serialVersionUID = 1024137371118887935L;
});
}
@@ -199,9 +202,7 @@ class ACTIVITYGUARD extends ACTIVITY {
}
public void run() {
- object(new ParentScopeChannelListener(_in) {
- private static final long serialVersionUID = 2667359535900385952L;
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(_in, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
_self.parent.compensate(scope,ret);
instance(TCONDINTERCEPT.this);
@@ -275,15 +276,16 @@ class ACTIVITYGUARD extends ACTIVITY {
(failureHandling == null ? 0L : failureHandling.retryDelay * 1000));
final TimerResponseChannel timerChannel = newChannel(TimerResponseChannel.class);
getBpelRuntimeContext().registerTimer(timerChannel, future);
- object(false, new TimerResponseChannelListener(timerChannel) {
+ object(false, new ReceiveProcess<TimerResponseChannel, TimerResponse>(timerChannel, new TimerResponse() {
+ public void onTimeout() {
+ ++_failure.retryCount;
+ startGuardedActivity();
+ }
+ public void onCancel() {
+ requireRecovery();
+ }
+ }) {
private static final long serialVersionUID = -261911108068231376L;
- public void onTimeout() {
- ++_failure.retryCount;
- startGuardedActivity();
- }
- public void onCancel() {
- requireRecovery();
- }
});
}
@@ -295,8 +297,7 @@ class ACTIVITYGUARD extends ACTIVITY {
getBpelRuntimeContext().registerActivityForRecovery(
recoveryChannel, _self.aId, _failure.reason, _failure.dateTime, _failure.data,
new String[] { "retry", "cancel", "fault" }, _failure.retryCount);
- object(false, new ActivityRecoveryChannelListener(recoveryChannel) {
- private static final long serialVersionUID = 8397883882810521685L;
+ object(false, new ReceiveProcess<ActivityRecoveryChannel, ActivityRecovery>(recoveryChannel, new ActivityRecovery() {
public void retry() {
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Retrying activity " + _self.aId + " (user initiated)");
@@ -321,19 +322,22 @@ class ACTIVITYGUARD extends ACTIVITY {
faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, _failure.reason);
completed(faultData, CompensationHandler.emptySet());
}
- }.or(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 2148587381204858397L;
-
+ }){
+ private static final long serialVersionUID = 8397883882810521685L;
+ }.or(new ReceiveProcess<TerminationChannel, Termination>(_self.self, 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/COMPENSATIONHANDLER_.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java?rev=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,18 +18,20 @@
*/
package org.apache.ode.bpel.runtime;
+import java.util.Iterator;
+import java.util.Set;
+
import org.apache.ode.bpel.evt.CompensationHandlerRegistered;
import org.apache.ode.bpel.evt.ScopeEvent;
import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.runtime.channels.CompensationChannelListener;
+import org.apache.ode.bpel.runtime.channels.Compensation;
+import org.apache.ode.bpel.runtime.channels.CompensationChannel;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
-
-import java.util.Iterator;
-import java.util.Set;
import org.w3c.dom.Element;
/**
@@ -47,9 +49,7 @@ class COMPENSATIONHANDLER_ extends BpelJ
public void run() {
sendEvent(new CompensationHandlerRegistered());
- object(new CompensationChannelListener(_self.compChannel) {
- private static final long serialVersionUID = -477602498730810094L;
-
+ object(new ReceiveProcess<CompensationChannel, Compensation>(_self.compChannel, new Compensation() {
public void forget() {
// Tell all our completed children to forget.
for (Iterator<CompensationHandler> i = _completedChildren.iterator(); i.hasNext(); )
@@ -74,9 +74,7 @@ class COMPENSATIONHANDLER_ extends BpelJ
// Create the compensation handler scope.
instance(new SCOPE(ai,compHandlerScopeFrame, new LinkFrame(null)));
- object(new ParentScopeChannelListener(ai.parent) {
- private static final long serialVersionUID = 8044120498580711546L;
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(ai.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
throw new AssertionError("Unexpected.");
}
@@ -95,8 +93,12 @@ 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;
});
}
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,6 +18,12 @@
*/
package org.apache.ode.bpel.runtime;
+import java.util.Calendar;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
@@ -25,27 +31,16 @@ import org.apache.ode.bpel.o.OEventHandl
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.runtime.channels.EventHandlerControl;
import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannel;
-import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannelListener;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.bpel.runtime.channels.TimerResponse;
import org.apache.ode.bpel.runtime.channels.TimerResponseChannel;
-import org.apache.ode.bpel.runtime.channels.TimerResponseChannelListener;
import org.apache.ode.jacob.ChannelListener;
import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.Calendar;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Date;
-
import org.w3c.dom.Element;
/**
@@ -136,19 +131,19 @@ class EH_ALARM extends BpelJacobRunnable
public void run() {
Calendar now = Calendar.getInstance();
- Set<ChannelListener<?>> listeners = new EventHandlerControlChannelListener(_cc) {
- private static final long serialVersionUID = -7750428941445331236L;
-
+ Set<ChannelListener<?>> listeners = new ReceiveProcess<EventHandlerControlChannel, EventHandlerControl>(_cc, new EventHandlerControl() {
public void stop() {
_psc.completed(null, _comps);
}
- }.or(new TerminationChannelListener(_tc) {
- private static final long serialVersionUID = 6100105997983514609L;
-
+ }){
+ private static final long serialVersionUID = -7750428941445331236L;
+ }.or(new ReceiveProcess<TerminationChannel, Termination>(_tc, new Termination() {
public void terminate() {
_psc.completed(null, _comps);
}
+ }) {
+ private static final long serialVersionUID = 6100105997983514609L;
});
if (_alarm == null) {
@@ -157,9 +152,7 @@ class EH_ALARM extends BpelJacobRunnable
TimerResponseChannel trc = newChannel(TimerResponseChannel.class);
getBpelRuntimeContext().registerTimer(trc,_alarm.getTime());
- listeners.add(new TimerResponseChannelListener(trc){
- private static final long serialVersionUID = 1110683632756756017L;
-
+ listeners.add(new ReceiveProcess<TimerResponseChannel, TimerResponse>(trc, new TimerResponse(){
public void onTimeout() {
// This is what we are waiting for, fire the activity
instance(new FIRE());
@@ -168,6 +161,8 @@ 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 */ {
@@ -178,7 +173,6 @@ class EH_ALARM extends BpelJacobRunnable
instance(createChild(child, _scopeFrame, new LinkFrame(null) ));
instance(new ACTIVE(child));
}
-
}
}
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -26,19 +26,20 @@ import org.apache.commons.logging.LogFac
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.CorrelationKeySet;
import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.o.OEventHandler;
import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.runtime.channels.EventHandlerControl;
import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannel;
-import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannelListener;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.PickResponse;
import org.apache.ode.bpel.runtime.channels.PickResponseChannel;
-import org.apache.ode.bpel.runtime.channels.PickResponseChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
-import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -163,9 +164,7 @@ class EH_EVENT extends BpelJacobRunnable
HashSet<ChannelListener<?>> mlset = new HashSet<ChannelListener<?>>();
if (!_terminated) {
- mlset.add(new TerminationChannelListener(_tc) {
- private static final long serialVersionUID = 7666910462948788042L;
-
+ mlset.add(new ReceiveProcess<TerminationChannel, Termination>(_tc, new Termination() {
public void terminate() {
terminateActive();
_terminated = true;
@@ -173,28 +172,26 @@ class EH_EVENT extends BpelJacobRunnable
getBpelRuntimeContext().cancel(_pickResponseChannel);
instance(WAITING.this);
}
+ }) {
+ private static final long serialVersionUID = 7666910462948788042L;
});
-
}
if (!_stopped) {
- mlset.add(new EventHandlerControlChannelListener(_ehc) {
- private static final long serialVersionUID = -1050788954724647970L;
-
+ mlset.add(new ReceiveProcess<EventHandlerControlChannel, EventHandlerControl>(_ehc, 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.add(new ParentScopeChannelListener(ai.parent) {
- private static final long serialVersionUID = 5341207762415360982L;
-
+ mlset.add(new ReceiveProcess<ParentScopeChannel, ParentScope>(ai.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
_psc.compensate(scope, ret);
instance(WAITING.this);
@@ -216,15 +213,14 @@ 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.add(new PickResponseChannelListener(_pickResponseChannel) {
- private static final long serialVersionUID = -4929999153478677288L;
-
-
- public void onRequestRcvd(int selectorIdx, String mexId) {
+ mlset.add(new ReceiveProcess<PickResponseChannel, PickResponse>(_pickResponseChannel, 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,
getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId, _oevent),
@@ -332,6 +328,8 @@ class EH_EVENT extends BpelJacobRunnable
public void onCancel() {
instance(new WAITING(null));
}
+ }) {
+ private static final long serialVersionUID = -4929999153478677288L;
});
object(false, mlset);
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,24 +18,25 @@
*/
package org.apache.ode.bpel.runtime;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
import org.apache.ode.bpel.o.OActivity;
import org.apache.ode.bpel.o.OFlow;
import org.apache.ode.bpel.o.OLink;
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.LinkStatusChannel;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.apache.ode.utils.stl.FilterIterator;
import org.apache.ode.utils.stl.MemberOfFunction;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
import org.w3c.dom.Element;
class FLOW extends ACTIVITY {
@@ -79,21 +80,19 @@ class FLOW extends ACTIVITY {
Iterator<ChildInfo> active = active();
if (active.hasNext()) {
Set<ChannelListener<?>> mlSet = new HashSet<ChannelListener<?>>();
- mlSet.add(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 2554750258974084466L;
-
+ mlSet.add(new ReceiveProcess<TerminationChannel, Termination>(_self.self, 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.add(new ParentScopeChannelListener(child.activity.parent) {
- private static final long serialVersionUID = -8027205709169238172L;
-
+ mlSet.add(new ReceiveProcess<ParentScopeChannel, ParentScope>(child.activity.parent, new ParentScope() {
public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
child.completed = true;
_compensations.addAll(compensations);
@@ -115,6 +114,8 @@ 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);
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -26,22 +26,23 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.o.OExpression;
import org.apache.ode.bpel.o.OForEach;
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.stl.FilterIterator;
import org.apache.ode.utils.stl.MemberOfFunction;
-import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -113,9 +114,7 @@ public class FOREACH extends ACTIVITY {
if (active().hasNext()) {
Set<ChannelListener<?>> mlSet = new HashSet<ChannelListener<?>>();
- mlSet.add(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 2554750257484084466L;
-
+ mlSet.add(new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
// Terminating all children before sepuku
for (Iterator<ChildInfo> i = active(); i.hasNext(); )
@@ -123,13 +122,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.add(new ParentScopeChannelListener(child.activity.parent) {
- private static final long serialVersionUID = -8027205709961438172L;
-
+ mlSet.add(new ReceiveProcess<ParentScopeChannel, ParentScope>(child.activity.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
// Forward compensation to parent
_self.parent.compensate(scope, ret);
@@ -162,6 +161,8 @@ 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);
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -26,20 +26,17 @@ import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.evt.ActivityFailureEvent;
-import org.apache.ode.bpel.evt.ActivityRecoveryEvent;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.o.OFailureHandling;
import org.apache.ode.bpel.o.OInvoke;
import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannel;
-import org.apache.ode.bpel.runtime.channels.ActivityRecoveryChannelListener;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.InvokeResponse;
import org.apache.ode.bpel.runtime.channels.InvokeResponseChannel;
-import org.apache.ode.bpel.runtime.channels.InvokeResponseChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
+import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -101,9 +98,7 @@ public class INVOKE extends ACTIVITY {
_scopeFrame.resolve(_oinvoke.partnerLink), _oinvoke.operation,
outboundMsg, invokeResponseChannel);
- object(false, new InvokeResponseChannelListener(invokeResponseChannel) {
- private static final long serialVersionUID = 4496880438819196765L;
-
+ object(false, new ReceiveProcess<InvokeResponseChannel, InvokeResponse>(invokeResponseChannel, new InvokeResponse() {
public void onResponse() {
// we don't have to write variable data -> this already
// happened in the nativeAPI impl
@@ -195,14 +190,15 @@ public class INVOKE extends ACTIVITY {
getBpelRuntimeContext().releasePartnerMex(mexId, false);
}
- }.or(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 4219496341785922396L;
-
+ }){
+ private static final long serialVersionUID = 4496880438819196765L;
+ }.or(new ReceiveProcess<TerminationChannel, Termination>(_self.self, 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/PICK.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java?rev=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -31,21 +31,23 @@ import org.apache.commons.logging.LogFac
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.CorrelationKeySet;
import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.explang.EvaluationException;
+import org.apache.ode.bpel.iapi.BpelEngineException;
import org.apache.ode.bpel.o.OElementVarType;
import org.apache.ode.bpel.o.OMessageVarType;
+import org.apache.ode.bpel.o.OMessageVarType.Part;
import org.apache.ode.bpel.o.OPickReceive;
import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.PickResponse;
import org.apache.ode.bpel.runtime.channels.PickResponseChannel;
-import org.apache.ode.bpel.runtime.channels.PickResponseChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
+import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.xsd.Duration;
-import org.apache.ode.bpel.evar.ExternalVariableModuleException;
-import org.apache.ode.bpel.iapi.BpelEngineException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -278,9 +280,7 @@ class PICK extends ACTIVITY {
}
public void run() {
- object(false, new PickResponseChannelListener(_pickResponseChannel) {
- private static final long serialVersionUID = -8237296827418738011L;
-
+ object(false, new ReceiveProcess<PickResponseChannel, PickResponse>(_pickResponseChannel, new PickResponse() {
public void onRequestRcvd(int selectorIdx, String mexId) {
OPickReceive.OnMessage onMessage = _opick.onMessages.get(selectorIdx);
@@ -372,13 +372,15 @@ class PICK extends ACTIVITY {
_self.parent.completed(null, CompensationHandler.emptySet());
}
- }.or(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 4399496341785922396L;
-
+ }){
+ private static final long serialVersionUID = -8237296827418738011L;
+ }.or(new ReceiveProcess<TerminationChannel, Termination>(_self.self, 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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,20 +18,21 @@
*/
package org.apache.ode.bpel.runtime;
+import java.util.Set;
+
import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
import org.apache.ode.bpel.o.OBase;
+import org.apache.ode.bpel.o.OFailureHandling;
import org.apache.ode.bpel.o.OProcess;
import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OFailureHandling;
import org.apache.ode.bpel.o.OScope.Variable;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
import org.apache.ode.bpel.runtime.channels.ReadWriteLockChannel;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
-
-import java.util.Set;
import org.w3c.dom.Element;
public class PROCESS extends BpelJacobRunnable {
@@ -59,9 +60,7 @@ 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 ParentScopeChannelListener(child.parent) {
- private static final long serialVersionUID = -8564969578471906493L;
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(child.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
assert false;
}
@@ -83,6 +82,8 @@ 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;
});
}
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -28,10 +28,11 @@ import org.apache.ode.bpel.explang.Evalu
import org.apache.ode.bpel.o.ORepeatUntil;
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
@@ -95,17 +96,15 @@ public class REPEATUNTIL extends ACTIVIT
}
public void run() {
- object(false, new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = -5471984635653784051L;
-
+ object(false, new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
_terminated = true;
replication(_child.self).terminate();
instance(WAITER.this);
}
- }.or(new ParentScopeChannelListener(_child.parent) {
- private static final long serialVersionUID = 3907167240907524405L;
-
+ }) {
+ private static final long serialVersionUID = -5471984635653784051L;
+ }.or(new ReceiveProcess<ParentScopeChannel, ParentScope>(_child.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
_self.parent.compensate(scope,ret);
instance(WAITER.this);
@@ -135,6 +134,8 @@ 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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -47,11 +47,12 @@ import org.apache.ode.bpel.o.OVarType;
import org.apache.ode.bpel.runtime.channels.CompensationChannel;
import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannel;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
@@ -142,9 +143,7 @@ class SCOPE extends ACTIVITY {
HashSet<ChannelListener<?>> mlSet = new HashSet<ChannelListener<?>>();
// Listen to messages from our parent.
- mlSet.add(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = 1913414844895865116L;
-
+ mlSet.add(new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
_terminated = true;
@@ -159,13 +158,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.add(new ParentScopeChannelListener(_child.parent) {
- private static final long serialVersionUID = -6934246487304813033L;
-
+ mlSet.add(new ReceiveProcess<ParentScopeChannel, ParentScope>(_child.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
// If this scope does not have available compensations, defer to
// parent scope, otherwise do compensation.
@@ -210,6 +209,8 @@ class SCOPE extends ACTIVITY {
CompensationHandler.emptySet());
}
+ }) {
+ private static final long serialVersionUID = -6934246487304813033L;
});
}
@@ -218,9 +219,7 @@ class SCOPE extends ACTIVITY {
for (Iterator<EventHandlerInfo> i = _eventHandlers.iterator();i.hasNext();) {
final EventHandlerInfo ehi = i.next();
- mlSet.add(new ParentScopeChannelListener(ehi.psc) {
- private static final long serialVersionUID = -4694721357537858221L;
-
+ mlSet.add(new ReceiveProcess<ParentScopeChannel, ParentScope>(ehi.psc, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
// ACTIVE scopes do not compensate, send request up to parent.
_self.parent.compensate(scope, ret);
@@ -250,6 +249,8 @@ 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);
@@ -293,9 +294,7 @@ class SCOPE extends ACTIVITY {
// Create the temination handler scope.
instance(new SCOPE(terminationHandlerActivity,terminationHandlerScopeFrame, SCOPE.this._linkFrame));
- object(new ParentScopeChannelListener(terminationHandlerActivity.parent) {
- private static final long serialVersionUID = -6009078124717125270L;
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(terminationHandlerActivity.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
// This should never happen.
throw new AssertionError("received compensate request!");
@@ -313,6 +312,8 @@ 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);
@@ -372,9 +373,7 @@ class SCOPE extends ACTIVITY {
// Create the fault handler scope.
instance(new SCOPE(faultHandlerActivity,faultHandlerScopeFrame, SCOPE.this._linkFrame));
- object(new ParentScopeChannelListener(faultHandlerActivity.parent) {
- private static final long serialVersionUID = -6009078124717125270L;
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(faultHandlerActivity.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
// This should never happen.
throw new AssertionError("received compensate request!");
@@ -391,6 +390,8 @@ 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 */ {
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -36,6 +36,7 @@ import org.apache.ode.bpel.runtime.chann
import org.apache.ode.bpel.runtime.channels.LinkStatus;
import org.apache.ode.bpel.runtime.channels.LinkStatusChannel;
import org.apache.ode.bpel.runtime.channels.LinkStatusChannelListener;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
import org.apache.ode.bpel.runtime.channels.ReadWriteLockChannel;
@@ -311,8 +312,7 @@ public class SCOPEACT extends ACTIVITY {
public void run() {
__log.debug("running UNLOCKER");
- object(new ParentScopeChannelListener(_self) {
-
+ object(new ReceiveProcess<ParentScopeChannel, ParentScope>(_self, new ParentScope() {
public void cancelled() {
_parent.cancelled();
unlockAll();
@@ -331,7 +331,6 @@ public class SCOPEACT extends ACTIVITY {
_linkStatusInterceptor.val(faultData == null);
unlockAll();
// no more listening
-
}
public void failure(String reason, Element data) {
@@ -340,7 +339,8 @@ 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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,24 +18,23 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OSequence;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
-import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
-import org.apache.ode.jacob.SynchChannel;
-
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.o.OSequence;
+import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
+import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
+import org.apache.ode.bpel.runtime.channels.Termination;
+import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.jacob.ReceiveProcess;
+import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
/**
@@ -78,9 +77,7 @@ class SEQUENCE extends ACTIVITY {
}
public void run() {
- object(false, new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = -2680515407515637639L;
-
+ object(false, new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
replication(_child.self).terminate();
@@ -92,9 +89,9 @@ class SEQUENCE extends ACTIVITY {
_terminateRequested = true;
instance(ACTIVE.this);
}
- }.or(new ParentScopeChannelListener(_child.parent) {
- private static final long serialVersionUID = 7195562310281985971L;
-
+ }) {
+ private static final long serialVersionUID = -2680515407515637639L;
+ }.or(new ReceiveProcess<ParentScopeChannel, ParentScope>(_child.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
_self.parent.compensate(scope,ret);
instance(ACTIVE.this);
@@ -115,6 +112,8 @@ 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;
}));
}
@@ -122,7 +121,6 @@ class SEQUENCE extends ACTIVITY {
for (Iterator<OActivity> i = remaining.iterator();i.hasNext();)
dpe(i.next());
}
-
}
public String toString() {
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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -18,20 +18,22 @@
*/
package org.apache.ode.bpel.runtime;
+import java.util.Calendar;
+import java.util.Date;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.o.OWait;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
+import org.apache.ode.bpel.runtime.channels.TerminationChannel;
+import org.apache.ode.bpel.runtime.channels.TimerResponse;
import org.apache.ode.bpel.runtime.channels.TimerResponseChannel;
-import org.apache.ode.bpel.runtime.channels.TimerResponseChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.utils.xsd.Duration;
-import java.util.Calendar;
-import java.util.Date;
-
/**
* JacobRunnable that performs the work of the <code><wait></code> activity.
@@ -66,9 +68,7 @@ class WAIT extends ACTIVITY {
final TimerResponseChannel timerChannel = newChannel(TimerResponseChannel.class);
getBpelRuntimeContext().registerTimer(timerChannel, dueDate);
- object(false, new TimerResponseChannelListener(timerChannel){
- private static final long serialVersionUID = 3120518305645437327L;
-
+ object(false, new ReceiveProcess<TimerResponseChannel, TimerResponse>(timerChannel, new TimerResponse() {
public void onTimeout() {
_self.parent.completed(null, CompensationHandler.emptySet());
}
@@ -76,14 +76,12 @@ class WAIT extends ACTIVITY {
public void onCancel() {
_self.parent.completed(null, CompensationHandler.emptySet());
}
- }.or(new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = -2791243270691333946L;
-
+ }){
+ private static final long serialVersionUID = 3120518305645437327L;
+ }.or(new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
_self.parent.completed(null, CompensationHandler.emptySet());
- object(new TimerResponseChannelListener(timerChannel) {
- private static final long serialVersionUID = 677746737897792929L;
-
+ object(new ReceiveProcess<TimerResponseChannel, TimerResponse>(timerChannel, new TimerResponse() {
public void onTimeout() {
//ignore
}
@@ -91,8 +89,12 @@ 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=1433527&r1=1433526&r2=1433527&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 15 17:10:18 2013
@@ -28,10 +28,11 @@ import org.apache.ode.bpel.explang.Evalu
import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.o.OWhile;
import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ParentScopeChannel;
-import org.apache.ode.bpel.runtime.channels.ParentScopeChannelListener;
+import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TerminationChannel;
-import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
+import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
@@ -113,17 +114,15 @@ class WHILE extends ACTIVITY {
}
public void run() {
- object(false, new TerminationChannelListener(_self.self) {
- private static final long serialVersionUID = -5471984635653784051L;
-
+ object(false, new ReceiveProcess<TerminationChannel, Termination>(_self.self, new Termination() {
public void terminate() {
_terminated = true;
replication(_child.self).terminate();
instance(WAITER.this);
}
- }.or(new ParentScopeChannelListener(_child.parent) {
- private static final long serialVersionUID = 3907167240907524405L;
-
+ }) {
+ private static final long serialVersionUID = -5471984635653784051L;
+ }.or(new ReceiveProcess<ParentScopeChannel, ParentScope>(_child.parent, new ParentScope() {
public void compensate(OScope scope, SynchChannel ret) {
_self.parent.compensate(scope,ret);
instance(WAITER.this);
@@ -139,6 +138,8 @@ 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;
}));
}
}