Author: dkulp
Date: Mon Jun 25 20:58:54 2012
New Revision: 1353741
URL: http://svn.apache.org/viewvc?rev=1353741&view=rev
Log:
Add javadoc to various methods in InterceptorChain
Allow to unpause a chain (slightly different than resume) and mark
difference in javadoc.
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/InterceptorChain.java
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/InterceptorChain.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/InterceptorChain.java?rev=1353741&r1=1353740&r2=1353741&view=diff
==============================================================================
---
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/InterceptorChain.java
(original)
+++
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/InterceptorChain.java
Mon Jun 25 20:58:54 2012
@@ -67,11 +67,33 @@ public interface InterceptorChain extend
boolean doInterceptStartingAt(Message message, String
startingAtInterceptorID);
+ /**
+ * Pauses the current chain. When the stack unwinds, the chain will just
+ * return from the doIntercept method normally.
+ */
void pause();
-
+
+ /**
+ * Suspends 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
+ */
void suspend();
+ /**
+ * Resumes the chain. The chain will use the current thread to continue
processing
+ * the last message that was passed into doIntercept
+ */
void resume();
+
+ /**
+ * If 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.
+ */
+ void unpause();
+
void reset();
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java?rev=1353741&r1=1353740&r2=1353741&view=diff
==============================================================================
---
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
(original)
+++
cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
Mon Jun 25 20:58:54 2012
@@ -158,7 +158,7 @@ public class OneWayProcessorInterceptor
message.getContextualProperty(
"org.apache.cxf.oneway.rejected_execution_exception"))) {
//the executor queue is full, so run the task in the
caller thread
- chain.resume();
+ chain.unpause();
}
} catch (InterruptedException e) {
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=1353741&r1=1353740&r2=1353741&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
Mon Jun 25 20:58:54 2012
@@ -219,16 +219,26 @@ public class PhaseInterceptorChain imple
public synchronized void pause() {
state = State.PAUSED;
+ pausedMessage = CURRENT_MESSAGE.get();
+ }
+ public synchronized void unpause() {
+ if (state == State.PAUSED || state == State.SUSPENDED) {
+ state = State.EXECUTING;
+ pausedMessage = null;
+ }
}
public synchronized void suspend() {
state = State.SUSPENDED;
+ pausedMessage = CURRENT_MESSAGE.get();
}
public synchronized void resume() {
if (state == State.PAUSED || state == State.SUSPENDED) {
state = State.EXECUTING;
- doIntercept(pausedMessage);
+ Message m = pausedMessage;
+ pausedMessage = null;
+ doIntercept(m);
}
}
@@ -241,7 +251,6 @@ public class PhaseInterceptorChain imple
@SuppressWarnings("unchecked")
public synchronized boolean doIntercept(Message message) {
updateIterator();
- pausedMessage = message;
Message oldMessage = CURRENT_MESSAGE.get();
try {
@@ -327,7 +336,6 @@ public class PhaseInterceptorChain imple
}
if (state == State.EXECUTING) {
state = State.COMPLETE;
- pausedMessage = null;
}
return state == State.COMPLETE;
} finally {