Package org.apache.cxf.phase
Class PhaseInterceptorChain
- java.lang.Object
- 
- org.apache.cxf.phase.PhaseInterceptorChain
 
- 
- All Implemented Interfaces:
- Iterable<Interceptor<? extends Message>>,- InterceptorChain
 
 public class PhaseInterceptorChain extends Object implements InterceptorChain A PhaseInterceptorChain orders Interceptors according to the phase they participate in and also according to the before & after properties on an Interceptor.A List of phases is supplied to the PhaseInterceptorChain in the constructor. This class is typically instantiated from the PhaseChainCache class in this package. Interceptors that are added to the chain are ordered by phase. Within a phase, interceptors can order themselves. Each PhaseInterceptor has an ID. PhaseInterceptors can supply a Collection of IDs which they should run before or after, supplying fine grained ordering. 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.cxf.interceptor.InterceptorChainInterceptorChain.State
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringPREVIOUS_MESSAGE- 
Fields inherited from interface org.apache.cxf.interceptor.InterceptorChainSTARTING_AFTER_INTERCEPTOR_ID, STARTING_AT_INTERCEPTOR_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description PhaseInterceptorChain(SortedSet<Phase> ps)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()voidadd(Collection<Interceptor<? extends Message>> newhandlers)Adds multiple interceptors to the interceptor chain.voidadd(Collection<Interceptor<? extends Message>> newhandlers, boolean force)voidadd(Interceptor<? extends Message> i)Adds a single interceptor to the interceptor chain.voidadd(Interceptor<? extends Message> i, boolean force)PhaseInterceptorChaincloneChain()booleandoIntercept(Message message)Intercept a message, invoking each phase's handlers in turn.booleandoInterceptStartingAfter(Message message, String startingAfterInterceptorID)Intercept a message, invoking each phase's handlers in turn, starting after the specified interceptor.booleandoInterceptStartingAt(Message message, String startingAtInterceptorID)Intercept a message, invoking each phase's handlers in turn, starting at the specified interceptor.static MessagegetCurrentMessage()MessageObservergetFaultObserver()ListIterator<Interceptor<? extends Message>>getIterator()InterceptorChain.StategetState()Iterator<Interceptor<? extends Message>>iterator()voidpause()Pauses the current chain.voidreleaseAndAcquireChain()voidreleaseChain()voidremove(Interceptor<? extends Message> i)voidreset()voidresume()Resumes the chain.static booleansetCurrentMessage(PhaseInterceptorChain chain, Message m)voidsetFaultObserver(MessageObserver faultObserver)voidsuspend()Suspends the current chain.StringtoString()voidunpause()If the chain is marked as paused, this will JUST mark the chain as in the EXECUTING phase.voidunwind(Message message)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Field Detail- 
PREVIOUS_MESSAGEpublic static final String PREVIOUS_MESSAGE 
 
- 
 - 
Method Detail- 
getCurrentMessagepublic static Message getCurrentMessage() 
 - 
setCurrentMessagepublic static boolean setCurrentMessage(PhaseInterceptorChain chain, Message m) 
 - 
getStatepublic InterceptorChain.State getState() - Specified by:
- getStatein interface- InterceptorChain
 
 - 
releaseAndAcquireChainpublic void releaseAndAcquireChain() 
 - 
releaseChainpublic void releaseChain() 
 - 
cloneChainpublic PhaseInterceptorChain cloneChain() 
 - 
addpublic void add(Collection<Interceptor<? extends Message>> newhandlers) Description copied from interface:InterceptorChainAdds multiple interceptors to the interceptor chain.- Specified by:
- addin interface- InterceptorChain
- Parameters:
- newhandlers- the interceptors to add to the chain
 
 - 
addpublic void add(Collection<Interceptor<? extends Message>> newhandlers, boolean force) 
 - 
addpublic void add(Interceptor<? extends Message> i) Description copied from interface:InterceptorChainAdds a single interceptor to the interceptor chain.- Specified by:
- addin interface- InterceptorChain
- Parameters:
- i- the interceptor to add
 
 - 
addpublic void add(Interceptor<? extends Message> i, boolean force) 
 - 
pausepublic void pause() Description copied from interface:InterceptorChainPauses the current chain. When the stack unwinds, the chain will just return from the doIntercept method normally.- Specified by:
- pausein interface- InterceptorChain
 
 - 
unpausepublic void unpause() Description copied from interface:InterceptorChainIf the chain is marked as paused, this will JUST mark the chain as in the EXECUTING phase. This is useful if an interceptor pauses the chain, but then immediately decides it should not have done that. It can unpause the chain and return normally and the normal processing will continue.- Specified by:
- unpausein interface- InterceptorChain
 
 - 
suspendpublic void suspend() Description copied from interface:InterceptorChainSuspends the current chain. When the stack unwinds, the chain back up the iterator by one (so on resume, the interceptor that called pause will be re-entered) and then throw a SuspendedInvocationException to the caller- Specified by:
- suspendin interface- InterceptorChain
 
 - 
resumepublic void resume() Description copied from interface:InterceptorChainResumes the chain. The chain will use the current thread to continue processing the last message that was passed into doIntercept- Specified by:
- resumein interface- InterceptorChain
 
 - 
doInterceptpublic boolean doIntercept(Message message) Intercept a message, invoking each phase's handlers in turn.- Specified by:
- doInterceptin interface- InterceptorChain
- Parameters:
- message- the message
- Throws:
- Exception
 
 - 
doInterceptStartingAfterpublic boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID) Intercept a message, invoking each phase's handlers in turn, starting after the specified interceptor.- Specified by:
- doInterceptStartingAfterin interface- InterceptorChain
- Parameters:
- message- the message
- startingAfterInterceptorID- the id of the interceptor
- Throws:
- Exception
 
 - 
doInterceptStartingAtpublic boolean doInterceptStartingAt(Message message, String startingAtInterceptorID) Intercept a message, invoking each phase's handlers in turn, starting at the specified interceptor.- Specified by:
- doInterceptStartingAtin interface- InterceptorChain
- Parameters:
- message- the message
- startingAtInterceptorID- the id of the interceptor
- Throws:
- Exception
 
 - 
resetpublic void reset() - Specified by:
- resetin interface- InterceptorChain
 
 - 
unwindpublic void unwind(Message message) 
 - 
removepublic void remove(Interceptor<? extends Message> i) - Specified by:
- removein interface- InterceptorChain
 
 - 
abortpublic void abort() - Specified by:
- abortin interface- InterceptorChain
 
 - 
iteratorpublic Iterator<Interceptor<? extends Message>> iterator() - Specified by:
- iteratorin interface- Iterable<Interceptor<? extends Message>>
 
 - 
getIteratorpublic ListIterator<Interceptor<? extends Message>> getIterator() - Specified by:
- getIteratorin interface- InterceptorChain
 
 - 
getFaultObserverpublic MessageObserver getFaultObserver() - Specified by:
- getFaultObserverin interface- InterceptorChain
 
 - 
setFaultObserverpublic void setFaultObserver(MessageObserver faultObserver) - Specified by:
- setFaultObserverin interface- InterceptorChain
 
 
- 
 
-