FYI, as far as designing continuation providers/wrappers is concerned, I
decided to drop a mutex parameter from
ContinuationProvider.getContinuation(Object mutex)
which in case of Jetty
maps to
class JettyContinuationProvider {
private HttpServletRequest req;
public ContinuationWrapper getContinuation(Object mutex) {
return new
JettyContinuationWrapper(ContinuationSupport..getContinuation(req, mutex));
}
}
The problem with supporting user-provider mutexes is that, say in case of Jetty, Continuation interface provides no getMutex()
method, but when dealing with continuations internally in CXF, we'd need to use them to synchronize an access to a given
ContinuationWrapper/Continuation. So we'd need to keep a map of user mutexes to continuation instances in say
JettyContinuationProvider.
So I reckon it's too much of the overhead, and CXF users, when writing continuations code will have to synchonize on
ContinuationWrapper instances, something what ServiceMix does when dealing with Jetty continuations.
Hope it makes sense - shout please if anyone has some practical examples when
disallowing user mutexes might be an issue
Cheers, Sergey
----- Original Message -----
From: "Sergey Beryozkin" <[EMAIL PROTECTED]>
To: <dev@cxf.apache.org>
Sent: Thursday, November 13, 2008 11:06 AM
Subject: Re: Jetty Continuations in CXF
I've added a simple HTTPS test and with HTTPS we have no luck at the moment,
CxfJettySslSocketConnector extends Jetty SslSocketConnector and calling continuation.suspend(timeout) simply blocks the calling
thread.
I've checked the archives and I believe at a time SslSelectChannelConnector[1] was considered unstable so instead a blocking
SslSocketConnector was picked up.
Any thoughts on what would it take to upgrade CxfJettySslSocketConnector to use
SslSelectChannelConnector ?
Thanks, Segey
[1]
http://www.mortbay.org/jetty/jetty-6/apidocs/org/mortbay/jetty/security/SslSelectChannelConnector.html
Question : how will SMX CXF Binding Component interact with (Jetty) continuations when dealing with CXF-originated invocations
? The Continuation wrappers will be available through an internal CXF input Message and through JAXWS WebServiceContext (or
JAXRS one later on) - will CXF BC be able to get hold of such wrappers ? If yes then I guess we have no problems at all ?
Yes, I think so, get continuation from cxf message
(org.apache.cxf.message.Message) is fine for CxfBcConsumer.
super.
I've just copied the relevant code only to sandbox as I didn't manage to create
a branch :
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations
Some comments. You can see in :
1. The wrapper interfaces for ContinuationSupport and Continuation in
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/api/src/main/java/org/apache/cxf/continuations
2. How PhaseInterceptorChain deals with suspended exceptions in
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
3. How AbstractInvoker deals with suspended exceptions in
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
4. How ChainInitiatorObserver deals with resuming an invocation chain in
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
5. Jetty-specific continuation wrappers in
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations
6. How JettyDestination deals with continuations :
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
7. System tests :
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/systests/src/test/java/org/apache/cxf/systest/jaxws/continuations
See the server code on how the test code interacts with continuations through
wrappers :
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/systests/src/test/java/org/apache/cxf/systest/jaxws/continuations/HelloImplWithWrapppedContinuation.java
and how it does so directly
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/systests/src/test/java/org/apache/cxf/systest/jaxws/continuations/HelloImplWithContinuation.java
check
https://svn.apache.org/repos/asf/cxf/sandbox/2.2.x-continuations/systests/src/test/java/org/apache/cxf/systest/jaxws/continuations/jetty-engine.xml
on how a jetty engine on a specific port can be told to ignore continuations which are supported by default if true is set or
that attribute is omitted (not used in the test though)
Ok - you can now see it it so shoot :-) Comments are welcome
Sergey