You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Alberto São Marcos <al...@gmail.com> on 2017/04/28 17:53:29 UTC

async endpoints - clean request thread before its suspended

i need to clean up some ThreadLocal states on requesting thread when its
work is done and is about to be _suspended_.

using CXF's/JAXRS async endpoints the thread used to deliver the request to
the server is not necessarily the same thread that is going to be used to
carry the response to the client.
in the tests i've performed, LoggingIn interceptors always run for the
requesting thread. There's no _Phase_ that runs after the user code and
before the thread is suspended. LoggingOut interceptors always run for the
response thread.

more also, AFAIK the available callbacks via the Continuation API or via
the @Suspended AsyncResponse response variable, do not allow to do
something before the thread is suspended.

so, with async rest endpoints, is there any cross-cutting concept (eg. an
interceptor) that enables the user to manipulate the request thread just
before its being suspended?