Package org.apache.synapse.continuation
Class ContinuationStackManager
- java.lang.Object
-
- org.apache.synapse.continuation.ContinuationStackManager
-
public class ContinuationStackManager extends Object
This is the utility class which manages ContinuationState Stack. All operations for the stack done by mediators are done through this manager class in order to easily control the operations from a central place.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SKIP_CONTINUATION_STATE
-
Constructor Summary
Constructors Constructor Description ContinuationStackManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addReliantContinuationState(MessageContext synCtx, int subBranch, int position)
Add a ReliantContinuationState to the top SeqContinuationState in the stack.static void
addSeqContinuationState(MessageContext synCtx, String seqName, SequenceType seqType)
Add new SeqContinuationState to the stack.static void
clearStack(MessageContext synCtx)
Remove all ContinuationStates from ContinuationState Stackstatic SeqContinuationState
getClonedSeqContinuationState(SeqContinuationState oriSeqContinuationState)
Get a clone of a SeqContinuationStatestatic boolean
isSkipSeqContinuationStateAddition(MessageContext synCtx)
Check whether sequence continuation state addition need to be skippedstatic ContinuationState
peakContinuationStateStack(MessageContext synCtx)
Peek from Continuation Stackstatic void
popContinuationStateStack(MessageContext synCtx)
Pop from Continuation Stackstatic void
pushFaultHandler(MessageContext synCtx, SeqContinuationState seqContState)
Push fault handler for the received continuation call response.static void
removeReliantContinuationState(MessageContext synCtx)
Remove a ReliantContinuationState from the top SeqContinuationState in the stack.static void
removeSeqContinuationState(MessageContext synCtx, SequenceType seqType)
Remove top SeqContinuationState from the stack.static SequenceMediator
retrieveSequence(MessageContext synCtx, SeqContinuationState seqContState)
Retrieve the sequence from Continuation state which message should be injected to.static void
updateSeqContinuationState(MessageContext synCtx, int position)
Update SeqContinuationState with the current mediator position in the sequence.
-
-
-
Field Detail
-
SKIP_CONTINUATION_STATE
public static final String SKIP_CONTINUATION_STATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
addSeqContinuationState
public static void addSeqContinuationState(MessageContext synCtx, String seqName, SequenceType seqType)
Add new SeqContinuationState to the stack. This should be done when branching to a new Sequence- Parameters:
synCtx
- Message ContextseqName
- Name of the branching sequenceseqType
- Sequence Type
-
isSkipSeqContinuationStateAddition
public static boolean isSkipSeqContinuationStateAddition(MessageContext synCtx)
Check whether sequence continuation state addition need to be skipped- Parameters:
synCtx
- message context- Returns:
- whether sequence continuation state addition need to be skipped
-
removeSeqContinuationState
public static void removeSeqContinuationState(MessageContext synCtx, SequenceType seqType)
Remove top SeqContinuationState from the stack. This should be done when returning from a Sequence branch.- Parameters:
synCtx
- Message Context
-
updateSeqContinuationState
public static void updateSeqContinuationState(MessageContext synCtx, int position)
Update SeqContinuationState with the current mediator position in the sequence. SeqContinuationState should be updated when branching to a new flow using a FlowContinuableMediator- Parameters:
synCtx
- Message Context
-
addReliantContinuationState
public static void addReliantContinuationState(MessageContext synCtx, int subBranch, int position)
Add a ReliantContinuationState to the top SeqContinuationState in the stack. This should be done when branching to a sub branch using FlowContinuableMediators except Sequence Mediator- Parameters:
synCtx
- Message ContextsubBranch
- Sub branch id
-
removeReliantContinuationState
public static void removeReliantContinuationState(MessageContext synCtx)
Remove a ReliantContinuationState from the top SeqContinuationState in the stack. This should be done when returning back from a sub branch of a FlowContinuableMediator.- Parameters:
synCtx
- MessageContext
-
getClonedSeqContinuationState
public static SeqContinuationState getClonedSeqContinuationState(SeqContinuationState oriSeqContinuationState)
Get a clone of a SeqContinuationState- Parameters:
oriSeqContinuationState
- original SeqContinuationState- Returns:
- cloned SeqContinuationState
-
clearStack
public static void clearStack(MessageContext synCtx)
Remove all ContinuationStates from ContinuationState Stack- Parameters:
synCtx
- MessageContext
-
peakContinuationStateStack
public static ContinuationState peakContinuationStateStack(MessageContext synCtx)
Peek from Continuation Stack- Returns:
- ContinuationState
-
popContinuationStateStack
public static void popContinuationStateStack(MessageContext synCtx)
Pop from Continuation Stack
-
retrieveSequence
public static SequenceMediator retrieveSequence(MessageContext synCtx, SeqContinuationState seqContState)
Retrieve the sequence from Continuation state which message should be injected to.- Parameters:
seqContState
- SeqContinuationState which contain the sequence informationsynCtx
- message context- Returns:
- sequence which message should be injected to
-
pushFaultHandler
public static void pushFaultHandler(MessageContext synCtx, SeqContinuationState seqContState)
Push fault handler for the received continuation call response.- Parameters:
seqContState
- SeqContinuationState which contain the sequence informationsynCtx
- message context
-
-