You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by sa...@apache.org on 2014/11/14 14:20:49 UTC
ode git commit: ODE-1020: Fixed deactivation of process services for
retiring processes.
Repository: ode
Updated Branches:
refs/heads/master e76025908 -> d86b18081
ODE-1020: Fixed deactivation of process services for retiring processes.
Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/d86b1808
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/d86b1808
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/d86b1808
Branch: refs/heads/master
Commit: d86b18081baf149b3bc6762964122c93642165cb
Parents: e760259
Author: sathwik <sa...@apache.org>
Authored: Fri Nov 14 18:50:20 2014 +0530
Committer: sathwik <sa...@apache.org>
Committed: Fri Nov 14 18:50:20 2014 +0530
----------------------------------------------------------------------
.../apache/ode/bpel/engine/BpelEngineImpl.java | 38 +++++++++++++++-----
.../org/apache/ode/bpel/engine/BpelProcess.java | 29 +++++++--------
2 files changed, 41 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ode/blob/d86b1808/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
index f2177cd..19bf53e 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
@@ -285,19 +285,39 @@ public class BpelEngineImpl implements BpelEngine {
if (__log.isDebugEnabled())
__log.debug("Deactivating process " + p.getPID());
- Iterator<List<BpelProcess>> serviceIter = _serviceMap.values().iterator();
- while (serviceIter.hasNext()) {
- Iterator<BpelProcess> entryProcesses = serviceIter.next().iterator();
- while (entryProcesses.hasNext()) {
- BpelProcess entryProcess = entryProcesses.next();
- if (entryProcess.getPID().equals(process)) {
- entryProcesses.remove();
+ boolean deactivate = true;
+ Iterator<Endpoint> endpointItr = p.getServiceNames().iterator();
+
+ ProcessState state = null;
+
+ while(endpointItr.hasNext()){
+ Endpoint endPoint = endpointItr.next();
+ List<BpelProcess> processList = _serviceMap.get(endPoint.serviceName);
+
+ Iterator<BpelProcess> processListItr = processList.iterator();
+
+ while(processListItr.hasNext()){
+ BpelProcess entryProcess = processListItr.next();
+ state = entryProcess.getConf().getState();
+ // Don't deactivate process services if there is another process in Active/Retired state and
+ // associated with the same service name
+ if( (ProcessState.ACTIVE.equals(state) || ProcessState.RETIRED.equals(state)) &&
+ !(entryProcess.getPID().equals(p.getPID()))) {
+
+ deactivate = false;
+ } else {
+ if(entryProcess.getPID().equals(process)) {
+ processListItr.remove();
+ }
}
}
}
- // unregister the services provided by the process
- p.deactivate();
+ if(deactivate){
+ // unregister the services provided by the process
+ p.deactivate();
+ }
+
// release the resources held by this process
p.dehydrate();
// update the process footprints list
http://git-wip-us.apache.org/repos/asf/ode/blob/d86b1808/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
index 7ab5d1e..55da99d 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
@@ -632,27 +632,22 @@ public class BpelProcess {
}
void deactivate() {
- // the BindingContext contains only the endpoints for the latest process version
- if (org.apache.ode.bpel.iapi.ProcessState.ACTIVE.equals(_pconf.getState())) {
- // Deactivate all the my-role endpoints.
- for (Endpoint endpoint : _myEprs.keySet()) {
- // Deactivate the EPR only if there are no more references
- // to this endpoint from any (active) BPEL process.
- if (isShareable(endpoint)) {
- if(__log.isDebugEnabled()) __log.debug("deactivating shared endpoint " + endpoint+ " for pid "+ _pid);
- if (!_sharedEps.decrementReferenceCount(endpoint)) {
- _engine._contexts.bindingContext.deactivateMyRoleEndpoint(endpoint);
- _sharedEps.removeEndpoint(endpoint);
- }
- } else {
- if(__log.isDebugEnabled()) __log.debug("deactivating non-shared endpoint " + endpoint + " for pid "+ _pid);
+ // Deactivate all the my-role endpoints.
+ for (Endpoint endpoint : _myEprs.keySet()) {
+ // Deactivate the EPR only if there are no more references
+ // to this endpoint from any (active) BPEL process.
+ if (isShareable(endpoint)) {
+ if(__log.isDebugEnabled()) __log.debug("deactivating shared endpoint " + endpoint+ " for pid "+ _pid);
+ if (!_sharedEps.decrementReferenceCount(endpoint)) {
_engine._contexts.bindingContext.deactivateMyRoleEndpoint(endpoint);
+ _sharedEps.removeEndpoint(endpoint);
}
+ } else {
+ if(__log.isDebugEnabled()) __log.debug("deactivating non-shared endpoint " + endpoint + " for pid "+ _pid);
+ _engine._contexts.bindingContext.deactivateMyRoleEndpoint(endpoint);
}
- // TODO Deactivate all the partner-role channels
- } else {
- if(__log.isDebugEnabled()) __log.debug("pid "+_pid+" is not ACTIVE, no endpoints to deactivate");
}
+ // TODO Deactivate all the partner-role channels
}
private boolean isShareable(Endpoint endpoint) {