public class PhaseInterceptorChain extends Object implements InterceptorChain
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.
InterceptorChain.State
Modifier and Type | Field and Description |
---|---|
static String |
PREVIOUS_MESSAGE |
STARTING_AFTER_INTERCEPTOR_ID, STARTING_AT_INTERCEPTOR_ID
Constructor and Description |
---|
PhaseInterceptorChain(SortedSet<Phase> ps) |
Modifier and Type | Method and Description |
---|---|
void |
abort() |
void |
add(Collection<Interceptor<? extends Message>> newhandlers)
Adds multiple interceptors to the interceptor chain.
|
void |
add(Collection<Interceptor<? extends Message>> newhandlers,
boolean force) |
void |
add(Interceptor<? extends Message> i)
Adds a single interceptor to the interceptor chain.
|
void |
add(Interceptor<? extends Message> i,
boolean force) |
PhaseInterceptorChain |
cloneChain() |
boolean |
doIntercept(Message message)
Intercept a message, invoking each phase's handlers in turn.
|
boolean |
doInterceptStartingAfter(Message message,
String startingAfterInterceptorID)
Intercept a message, invoking each phase's handlers in turn,
starting after the specified interceptor.
|
boolean |
doInterceptStartingAt(Message message,
String startingAtInterceptorID)
Intercept a message, invoking each phase's handlers in turn,
starting at the specified interceptor.
|
static Message |
getCurrentMessage() |
MessageObserver |
getFaultObserver() |
ListIterator<Interceptor<? extends Message>> |
getIterator() |
InterceptorChain.State |
getState() |
Iterator<Interceptor<? extends Message>> |
iterator() |
void |
pause()
Pauses the current chain.
|
void |
releaseAndAcquireChain() |
void |
releaseChain() |
void |
remove(Interceptor<? extends Message> i) |
void |
reset() |
void |
resume()
Resumes the chain.
|
static boolean |
setCurrentMessage(PhaseInterceptorChain chain,
Message m) |
void |
setFaultObserver(MessageObserver faultObserver) |
void |
suspend()
Suspends the current chain.
|
String |
toString() |
void |
unpause()
If the chain is marked as paused, this will JUST mark the chain as
in the EXECUTING phase.
|
void |
unwind(Message message) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String PREVIOUS_MESSAGE
public static Message getCurrentMessage()
public static boolean setCurrentMessage(PhaseInterceptorChain chain, Message m)
public InterceptorChain.State getState()
getState
in interface InterceptorChain
public void releaseAndAcquireChain()
public void releaseChain()
public PhaseInterceptorChain cloneChain()
public void add(Collection<Interceptor<? extends Message>> newhandlers)
InterceptorChain
add
in interface InterceptorChain
newhandlers
- the interceptors to add to the chainpublic void add(Collection<Interceptor<? extends Message>> newhandlers, boolean force)
public void add(Interceptor<? extends Message> i)
InterceptorChain
add
in interface InterceptorChain
i
- the interceptor to addpublic void add(Interceptor<? extends Message> i, boolean force)
public void pause()
InterceptorChain
pause
in interface InterceptorChain
public void unpause()
InterceptorChain
unpause
in interface InterceptorChain
public void suspend()
InterceptorChain
suspend
in interface InterceptorChain
public void resume()
InterceptorChain
resume
in interface InterceptorChain
public boolean doIntercept(Message message)
doIntercept
in interface InterceptorChain
message
- the messageException
public boolean doInterceptStartingAfter(Message message, String startingAfterInterceptorID)
doInterceptStartingAfter
in interface InterceptorChain
message
- the messagestartingAfterInterceptorID
- the id of the interceptorException
public boolean doInterceptStartingAt(Message message, String startingAtInterceptorID)
doInterceptStartingAt
in interface InterceptorChain
message
- the messagestartingAtInterceptorID
- the id of the interceptorException
public void reset()
reset
in interface InterceptorChain
public void unwind(Message message)
public void remove(Interceptor<? extends Message> i)
remove
in interface InterceptorChain
public void abort()
abort
in interface InterceptorChain
public Iterator<Interceptor<? extends Message>> iterator()
iterator
in interface Iterable<Interceptor<? extends Message>>
public ListIterator<Interceptor<? extends Message>> getIterator()
getIterator
in interface InterceptorChain
public MessageObserver getFaultObserver()
getFaultObserver
in interface InterceptorChain
public void setFaultObserver(MessageObserver faultObserver)
setFaultObserver
in interface InterceptorChain
Copyright © 2019 JBoss by Red Hat. All rights reserved.