Author: hadrian
Date: Tue Jan 22 03:00:40 2013
New Revision: 1436732

URL: http://svn.apache.org/viewvc?rev=1436732&view=rev
Log:
ODE-987. Remove the last places that use the collection version of object()

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/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/SCOPE.java
    
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/CompositeProcess.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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -48,6 +48,7 @@ import org.apache.ode.bpel.runtime.chann
 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;
 import org.w3c.dom.Element;
@@ -106,8 +107,7 @@ class ACTIVITYGUARD extends ACTIVITY {
                 dpe(_oactivity);
             }
         } else /* don't know all our links statuses */ {
-            Set<ChannelListener> mlset = new HashSet<ChannelListener>();
-            mlset.add(new ReceiveProcess<Termination>(_self.self, new 
Termination() {
+            CompositeProcess mlset = compose(new 
ReceiveProcess<Termination>(_self.self, new Termination() {
                 public void terminate() {
                     // Complete immediately, without faulting or registering 
any comps.
                     _self.parent.completed(null, 
CompensationHandler.emptySet());
@@ -118,7 +118,7 @@ class ACTIVITYGUARD extends ACTIVITY {
                 private static final long serialVersionUID = 
5094153128476008961L;
             });
             for (final OLink link : _oactivity.targetLinks) {
-                mlset.add(new 
ReceiveProcess<LinkStatus>(_linkFrame.resolve(link).sub, new LinkStatus() {
+                mlset.or(new 
ReceiveProcess<LinkStatus>(_linkFrame.resolve(link).sub, new LinkStatus() {
                     public void linkStatus(boolean value) {
                         _linkVals.put(link, Boolean.valueOf(value));
                         instance(ACTIVITYGUARD.this);

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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -34,13 +34,14 @@ import org.apache.ode.bpel.runtime.chann
 import org.apache.ode.bpel.runtime.channels.ParentScope;
 import org.apache.ode.bpel.runtime.channels.PickResponse;
 import org.apache.ode.bpel.runtime.channels.Termination;
-import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.CompositeProcess;
 import org.apache.ode.jacob.ProcessUtil;
 import org.apache.ode.jacob.ReceiveProcess;
 import org.apache.ode.jacob.Synch;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+
 /**
  * Message event handler.
  */
@@ -158,10 +159,10 @@ class EH_EVENT extends BpelJacobRunnable
 
         public void run() {
             if (!_active.isEmpty() || _pickResponseChannel != null) {
-                HashSet<ChannelListener> mlset = new 
HashSet<ChannelListener>();
+                CompositeProcess mlset = ProcessUtil.compose(null);
 
                 if (!_terminated) {
-                    mlset.add(new ReceiveProcess<Termination>(_tc, new 
Termination() {
+                    mlset.or(new ReceiveProcess<Termination>(_tc, new 
Termination() {
                         public void terminate() {
                             terminateActive();
                             _terminated = true;
@@ -175,7 +176,7 @@ class EH_EVENT extends BpelJacobRunnable
                 }
 
                 if (!_stopped) {
-                    mlset.add(new ReceiveProcess<EventHandlerControl>(_ehc, 
new EventHandlerControl() {
+                    mlset.or(new ReceiveProcess<EventHandlerControl>(_ehc, new 
EventHandlerControl() {
                         public void stop() {
                             _stopped = true;
                             if (_pickResponseChannel != null)
@@ -188,7 +189,7 @@ class EH_EVENT extends BpelJacobRunnable
                 }
 
                 for (final ActivityInfo ai : _active) {
-                    mlset.add(new ReceiveProcess<ParentScope>(ai.parent, new 
ParentScope() {
+                    mlset.or(new ReceiveProcess<ParentScope>(ai.parent, new 
ParentScope() {
                         public void compensate(OScope scope, Synch ret) {
                             _psc.compensate(scope, ret);
                             instance(WAITING.this);
@@ -216,7 +217,7 @@ class EH_EVENT extends BpelJacobRunnable
                 }
 
                 if (_pickResponseChannel != null)
-                    mlset.add(new 
ReceiveProcess<PickResponse>(_pickResponseChannel, new PickResponse() {
+                    mlset.or(new 
ReceiveProcess<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,

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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -31,6 +31,8 @@ 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.jacob.ChannelListener;
+import org.apache.ode.jacob.CompositeProcess;
+import org.apache.ode.jacob.ProcessUtil;
 import org.apache.ode.jacob.ReceiveProcess;
 import org.apache.ode.jacob.Synch;
 import org.apache.ode.utils.stl.FilterIterator;
@@ -77,8 +79,7 @@ class FLOW extends ACTIVITY {
         public void run() {
             Iterator<ChildInfo> active = active();
             if (active.hasNext()) {
-                Set<ChannelListener> mlSet = new HashSet<ChannelListener>();
-                mlSet.add(new ReceiveProcess<Termination>(_self.self, new 
Termination() {
+                CompositeProcess mlSet = ProcessUtil.compose(new 
ReceiveProcess<Termination>(_self.self, new Termination() {
                     public void terminate() {
                         for (Iterator<ChildInfo> i = active(); i.hasNext(); )
                             replication(i.next().activity.self).terminate();
@@ -90,7 +91,7 @@ class FLOW extends ACTIVITY {
 
                 for (;active.hasNext();) {
                     final ChildInfo child = active.next();
-                    mlSet.add(new 
ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
+                    mlSet.or(new 
ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
                         public void completed(FaultData faultData, 
Set<CompensationHandler> compensations) {
                             child.completed = true;
                             _compensations.addAll(compensations);
@@ -116,7 +117,7 @@ class FLOW extends ACTIVITY {
                         private static final long serialVersionUID = 
-8027205709169238172L;
                     });
                 }
-                object(false,mlSet);
+                object(false, mlSet);
             } else /** No More active children. */ {
                 // NOTE: we do not not have to do DPE here because all the 
children
                 // have been started, and are therefore expected to set the 
value of

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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -35,7 +35,8 @@ 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.Termination;
-import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.CompositeProcess;
+import org.apache.ode.jacob.ProcessUtil;
 import org.apache.ode.jacob.ReceiveProcess;
 import org.apache.ode.jacob.Synch;
 import org.apache.ode.utils.DOMUtils;
@@ -110,9 +111,7 @@ public class FOREACH extends ACTIVITY {
             Iterator<ChildInfo> active = active();
             // Continuing as long as a child is active
             if (active().hasNext()) {
-
-                Set<ChannelListener> mlSet = new HashSet<ChannelListener>();
-                mlSet.add(new ReceiveProcess<Termination>(_self.self, new 
Termination() {
+                CompositeProcess mlSet = ProcessUtil.compose(new 
ReceiveProcess<Termination>(_self.self, new Termination() {
                     public void terminate() {
                         // Terminating all children before sepuku
                         for (Iterator<ChildInfo> i = active(); i.hasNext(); )
@@ -126,7 +125,7 @@ public class FOREACH extends ACTIVITY {
                 for (;active.hasNext();) {
                     // Checking out our children
                     final ChildInfo child = active.next();
-                    mlSet.add(new 
ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
+                    mlSet.or(new 
ReceiveProcess<ParentScope>(child.activity.parent, new ParentScope() {
                         public void compensate(OScope scope, Synch ret) {
                             // Forward compensation to parent
                             _self.parent.compensate(scope, ret);
@@ -163,7 +162,7 @@ public class FOREACH extends ACTIVITY {
                         private static final long serialVersionUID = 
-8027205709961438172L;
                     });
                 }
-                object(false,mlSet);
+                object(false, mlSet);
             } else {
                 // No children left, either because they've all been executed 
or because we
                 // had to make them stop.

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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -49,11 +49,13 @@ import org.apache.ode.bpel.runtime.chann
 import org.apache.ode.bpel.runtime.channels.FaultData;
 import org.apache.ode.bpel.runtime.channels.ParentScope;
 import org.apache.ode.bpel.runtime.channels.Termination;
-import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.CompositeProcess;
+import org.apache.ode.jacob.ProcessUtil;
 import org.apache.ode.jacob.ReceiveProcess;
 import org.apache.ode.jacob.Synch;
 import org.w3c.dom.Element;
 
+
 /**
  * An active scope.
  */
@@ -138,10 +140,7 @@ class SCOPE extends ACTIVITY {
 
         public void run() {
             if (_child != null || !_eventHandlers.isEmpty()) {
-                HashSet<ChannelListener> mlSet = new 
HashSet<ChannelListener>();
-
-                // Listen to messages from our parent.
-                mlSet.add(new ReceiveProcess<Termination>(_self.self, new 
Termination() {
+                CompositeProcess mlSet = ProcessUtil.compose(new 
ReceiveProcess<Termination>(_self.self, new Termination() {
                     public void terminate() {
                         _terminated = true;
 
@@ -162,7 +161,7 @@ class SCOPE extends ACTIVITY {
 
                 // Handle messages from the child if it is still alive
                 if (_child != null) {
-                    mlSet.add(new ReceiveProcess<ParentScope>(_child.parent, 
new ParentScope() {
+                    mlSet.or(new ReceiveProcess<ParentScope>(_child.parent, 
new ParentScope() {
                         public void compensate(OScope scope, Synch ret) {
                             //  If this scope does not have available 
compensations, defer to
                             // parent scope, otherwise do compensation.
@@ -217,7 +216,7 @@ class SCOPE extends ACTIVITY {
                 for (Iterator<EventHandlerInfo> i = 
_eventHandlers.iterator();i.hasNext();) {
                     final EventHandlerInfo ehi = i.next();
 
-                    mlSet.add(new ReceiveProcess<ParentScope>(ehi.psc, new 
ParentScope() {
+                    mlSet.or(new ReceiveProcess<ParentScope>(ehi.psc, new 
ParentScope() {
                         public void compensate(OScope scope, Synch ret) {
                             // ACTIVE scopes do not compensate, send request 
up to parent.
                             _self.parent.compensate(scope, ret);

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=1436732&r1=1436731&r2=1436732&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 03:00:40 2013
@@ -36,7 +36,8 @@ import org.apache.ode.bpel.runtime.chann
 import org.apache.ode.bpel.runtime.channels.LinkStatus;
 import org.apache.ode.bpel.runtime.channels.ParentScope;
 import org.apache.ode.bpel.runtime.channels.ReadWriteLock;
-import org.apache.ode.jacob.ChannelListener;
+import org.apache.ode.jacob.CompositeProcess;
+import org.apache.ode.jacob.ProcessUtil;
 import org.apache.ode.jacob.ReceiveProcess;
 import org.apache.ode.jacob.Synch;
 import org.apache.ode.jacob.Val;
@@ -147,10 +148,9 @@ public class SCOPEACT extends ACTIVITY {
 
             __log.debug("LINKSTATUSINTERCEPTOR: running ");
 
-            Set<ChannelListener> mlset = new HashSet<ChannelListener>();
-            
+            CompositeProcess mlset = ProcessUtil.compose(null);
             if (_status == null)
-                mlset.add(new ReceiveProcess<Val>(_self, new Val() {
+                mlset.or(new ReceiveProcess<Val>(_self, 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()) {
@@ -174,7 +174,7 @@ public class SCOPEACT extends ACTIVITY {
                 if (_statuses.containsKey(m.getKey()))
                     continue;
             
-                mlset.add(new ReceiveProcess<LinkStatus>(m.getValue().pub, new 
LinkStatus() {
+                mlset.or(new ReceiveProcess<LinkStatus>(m.getValue().pub, new 
LinkStatus() {
                     public void linkStatus(boolean value) {
                         _statuses.put(m.getKey(), value);
                         if (_status != null)
@@ -190,7 +190,6 @@ public class SCOPEACT extends ACTIVITY {
             }
             
             object(false, mlset);
-
         }
 
         /**
@@ -199,7 +198,6 @@ public class SCOPEACT extends ACTIVITY {
          */
         private boolean isDone() {
             return (_statuses.keySet().size() < 
SCOPEACT.this._self.o.outgoingLinks.size());
-
         }
     }
     

Modified: 
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/CompositeProcess.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/CompositeProcess.java?rev=1436732&r1=1436731&r2=1436732&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/CompositeProcess.java 
(original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/CompositeProcess.java 
Tue Jan 22 03:00:40 2013
@@ -46,7 +46,9 @@ public final class CompositeProcess exte
     }
 
     public CompositeProcess or(ChannelListener process) {
-        processes.add(process);
+        if (process != null) {
+            processes.add(process);
+        }
         return this;
     }
 }


Reply via email to