[
https://issues.apache.org/jira/browse/CXF-5417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13869535#comment-13869535
]
Sergey Beryozkin commented on CXF-5417:
---------------------------------------
Hi Andriy, thanks, the only problem is that JAX-RS 2.0 ConnectionCallback can
not be (indirectly) detected in Servlet3Continuation constructor, the
constructor code above will only work for users working with CXF Continuations
API directly.
Specifically, JAXRS AsyncResponse accepts callbacks in one of its register()
methods. So in CXF JAXRS AsyncResponseImpl will need to register itself as CXF
ConnectionCallback wrapper with its Continuation instance after the latter has
been constructed, doing so earlier would start a Timer which may not be even
needed. One option here is to enhance Continuation interface with a single
registerCallback method, but may be we can simplify it by reusing
Continuation.setObject method,
So if the user code calls AsyncResponse.register(new MyConnectionCallback()),
then we'd relay it to Continuation.setObject and check inside
Servlet3Continuation if it is CXF ConnectionCallback - if yes then deal with it
Cheers, Sergey
> Support optional JAX-RS 2.0 ConnectionCallback
> ----------------------------------------------
>
> Key: CXF-5417
> URL: https://issues.apache.org/jira/browse/CXF-5417
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS, Transports
> Reporter: Sergey Beryozkin
> Priority: Minor
>
> https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/container/ConnectionCallback.html
> lets JAX-RS 2.0 applications receive the notifications when a given client
> has disconnected.
> We can probably build something on top of the Jetty-specific connector and
> also enhance CXF Continuation API.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)