Merged in ESBCOMP-85-bpel-se-suffers-from-memory-l (pull request #27)
ESBCOMP-70 Fix to improve memory leak in BPEL-SEmaster
commit
c6ad728ad5
|
@ -1221,15 +1221,21 @@ public class BPELProcessInstanceImpl extends StructuredActivityUnitImpl implemen
|
|||
* pushCompletedScope(com.sun.jbi.engine.bpel.core.bpel.model.runtime.Context)
|
||||
*/
|
||||
public int pushCompletedScope(Context completedScope) {
|
||||
synchronized (mCompletedScopes) {
|
||||
if (currentProcessState == ProcessState.Running
|
||||
|| currentProcessState == ProcessState.WaitingForEventsToComplete) {
|
||||
mCompletedScopes.push(completedScope);
|
||||
return mCompletedScopes.size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
synchronized (mCompletedScopes) {
|
||||
if(completedScope instanceof ScopeUnitImpl){
|
||||
|
||||
ScopeUnitImpl completedScopeUnit = (ScopeUnitImpl)completedScope;
|
||||
|
||||
if((completedScopeUnit.hasCompensationHandler() || completedScopeUnit.hasFaultHandler() || completedScopeUnit.hasEventHandler() || completedScopeUnit.hasTerminationHandler()) &&
|
||||
(currentProcessState == ProcessState.Running || currentProcessState == ProcessState.WaitingForEventsToComplete))
|
||||
{
|
||||
mCompletedScopes.push(completedScope);
|
||||
return mCompletedScopes.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1682,4 +1688,4 @@ public class BPELProcessInstanceImpl extends StructuredActivityUnitImpl implemen
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,6 +57,7 @@ import com.sun.bpel.model.meta.RPartnerLink;
|
|||
import com.sun.bpel.model.meta.RReply;
|
||||
import com.sun.bpel.model.meta.RStartElement;
|
||||
import com.sun.bpel.model.meta.RVariable;
|
||||
import com.sun.bpel.model.meta.impl.RScopeImpl;
|
||||
import com.sun.jbi.engine.bpel.core.bpel.engine.BPELProcessInstance;
|
||||
import com.sun.jbi.engine.bpel.core.bpel.engine.BPELProcessManager;
|
||||
import com.sun.jbi.engine.bpel.core.bpel.engine.BusinessProcessInstanceThread;
|
||||
|
@ -1352,6 +1353,27 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
|||
}
|
||||
}
|
||||
|
||||
public boolean hasCompensationHandler() {
|
||||
return mAct instanceof RScopeImpl &&
|
||||
((RScopeImpl)mAct).getCompensationHandler() != null;
|
||||
}
|
||||
|
||||
public boolean hasFaultHandler() {
|
||||
return mAct instanceof RScopeImpl &&
|
||||
((RScopeImpl)mAct).getFaultHandlers() != null;
|
||||
}
|
||||
|
||||
public boolean hasTerminationHandler() {
|
||||
return mAct instanceof RScopeImpl &&
|
||||
((RScopeImpl)mAct).getTerminationHandler() != null;
|
||||
}
|
||||
|
||||
public boolean hasEventHandler() {
|
||||
return mAct instanceof RScopeImpl &&
|
||||
((RScopeImpl)mAct).getEventHandlers() != null;
|
||||
}
|
||||
|
||||
|
||||
private Context popCompletedScope() {
|
||||
try {
|
||||
return mCompletedScopes.pop();
|
||||
|
@ -1505,4 +1527,3 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue