Enclosed scopes unregister themselves now if they carry no compensation handlers.
parent
84c93a67ed
commit
183d50ed81
|
@ -109,6 +109,12 @@ public interface FaultHandlingContext {
|
||||||
*/
|
*/
|
||||||
void registerEnclosedScope(FaultHandlingContext enclosedScope);
|
void registerEnclosedScope(FaultHandlingContext enclosedScope);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes itself from the parent context.
|
||||||
|
* @param enclosedScope
|
||||||
|
*/
|
||||||
|
void unregisterEnclosedScope(FaultHandlingContext enclosedScope);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a callframe is created it will be registered with the FaultHandlingContext.
|
* When a callframe is created it will be registered with the FaultHandlingContext.
|
||||||
* This is used by the FaultHandlingContext to remove any callframe that is waiting
|
* This is used by the FaultHandlingContext to remove any callframe that is waiting
|
||||||
|
|
|
@ -862,6 +862,14 @@ public class BPELProcessInstanceImpl extends StructuredActivityUnitImpl implemen
|
||||||
enclosedScopes.add(enclosedScope);
|
enclosedScopes.add(enclosedScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext#unregisterEnclosedScope(
|
||||||
|
* com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext)
|
||||||
|
*/
|
||||||
|
public void unregisterEnclosedScope(FaultHandlingContext enclosedScope) {
|
||||||
|
enclosedScopes.remove(enclosedScope);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext#notifyFault(
|
* @see com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext#notifyFault(
|
||||||
* com.sun.jbi.engine.bpel.core.bpel.model.runtime.Fault,
|
* com.sun.jbi.engine.bpel.core.bpel.model.runtime.Fault,
|
||||||
|
|
|
@ -291,6 +291,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
currentScopeState = ScopeState.Completed;
|
currentScopeState = ScopeState.Completed;
|
||||||
// clear all the FH related data as the scope has completed.
|
// clear all the FH related data as the scope has completed.
|
||||||
clearFHRelatedData();
|
clearFHRelatedData();
|
||||||
|
unregisterFromParent(this);
|
||||||
// push this completed scope instance to the parent sope stack of completed scopes.
|
// push this completed scope instance to the parent sope stack of completed scopes.
|
||||||
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
||||||
updateScopeOnState(rObjs);
|
updateScopeOnState(rObjs);
|
||||||
|
@ -310,6 +311,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
currentScopeState = ScopeState.Completed;
|
currentScopeState = ScopeState.Completed;
|
||||||
// clear all the FH related data as the scope has completed.
|
// clear all the FH related data as the scope has completed.
|
||||||
clearFHRelatedData();
|
clearFHRelatedData();
|
||||||
|
unregisterFromParent(this);
|
||||||
// push this completed scope instance to the parent scope stack of completed scopes.
|
// push this completed scope instance to the parent scope stack of completed scopes.
|
||||||
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
||||||
updateScopeOnState(rObjs);
|
updateScopeOnState(rObjs);
|
||||||
|
@ -391,6 +393,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
currentScopeState = ScopeState.Completed;
|
currentScopeState = ScopeState.Completed;
|
||||||
// clear all the FH related data as the scope has completed.
|
// clear all the FH related data as the scope has completed.
|
||||||
clearFHRelatedData();
|
clearFHRelatedData();
|
||||||
|
unregisterFromParent(this);
|
||||||
// push this completed scope instance to the parent scope stack of completed scopes.
|
// push this completed scope instance to the parent scope stack of completed scopes.
|
||||||
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
mCompletionOrder = getParentContext().getFaultHandlingContext().pushCompletedScope(this);
|
||||||
updateScopeOnState(rObjs);
|
updateScopeOnState(rObjs);
|
||||||
|
@ -714,6 +717,14 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
enclosedScopes.add(enclosedScope);
|
enclosedScopes.add(enclosedScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void unregisterEnclosedScope(FaultHandlingContext enclosedScope) {
|
||||||
|
enclosedScopes.remove(enclosedScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unregisterFromParent(FaultHandlingContext scope) {
|
||||||
|
mContext.getFaultHandlingContext().unregisterEnclosedScope(scope);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext#notifyFault(
|
* @see com.sun.jbi.engine.bpel.core.bpel.model.runtime.FaultHandlingContext#notifyFault(
|
||||||
* com.sun.jbi.engine.bpel.core.bpel.model.runtime.Fault,
|
* com.sun.jbi.engine.bpel.core.bpel.model.runtime.Fault,
|
||||||
|
@ -807,6 +818,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
|
|
||||||
// clean the FH related data.
|
// clean the FH related data.
|
||||||
clearFHRelatedData();
|
clearFHRelatedData();
|
||||||
|
unregisterFromParent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearFHRelatedData() {
|
private void clearFHRelatedData() {
|
||||||
|
@ -1252,6 +1264,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
removeVariableReferences();
|
removeVariableReferences();
|
||||||
frame.getProcessInstance().getPersistenctMgr().updateState(this,
|
frame.getProcessInstance().getPersistenctMgr().updateState(this,
|
||||||
mContext.getStateContext().getState(), true);
|
mContext.getStateContext().getState(), true);
|
||||||
|
unregisterFromParent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1460,6 +1473,7 @@ public class ScopeUnitImpl extends StructuredActivityUnitImpl implements Context
|
||||||
*/
|
*/
|
||||||
private void updateScopeStateAsDone(boolean persistenceEnabled, RequiredObjects rObjs) {
|
private void updateScopeStateAsDone(boolean persistenceEnabled, RequiredObjects rObjs) {
|
||||||
currentScopeState = ScopeState.Done;
|
currentScopeState = ScopeState.Done;
|
||||||
|
unregisterFromParent(this);
|
||||||
// update the Scope on the StateImpl
|
// update the Scope on the StateImpl
|
||||||
if (persistenceEnabled) {
|
if (persistenceEnabled) {
|
||||||
updateScopeOnState(rObjs);
|
updateScopeOnState(rObjs);
|
||||||
|
|
Loading…
Reference in New Issue