You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by Frank Langel <fr...@frankjlangel.com> on 2015/06/25 14:45:34 UTC

Interceptor | org.apache.wink.server.handlers.HandlersFactory example

Hi Apache Wink team,

I would like to execute some code just before the REST method is called
1. The code would access Http header parameters
2. I want to bind some information onto the thread that executes the REST
method using ThreadLocal
Apache Wink is kind of old (latest post 2010)  and documentation hard to
find
1. Has anyone build an interceptor similar to the one described
2. Has anyone experience with
org.apache.wink.server.handlers.HandlersFactory ? Can I use it for this
purpose?
Thanks a lot in advance
Frank




Re: Interceptor | org.apache.wink.server.handlers.HandlersFactory example

Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
Hi Frank

We have been using WebSphere 8.5 for some time now. It uses Wink as the
implementation for JAX-RS.

You should have no problem creating CDI Interceptors and applying them to
methods in the resource class. We have done that for several use-cases.
Instead of using TLS we use a @RequestScoped bean to pass data around and
make it available to the executing thread.

The problem with using the HandlersFactory is that the WINK infrastructure
uses new on the class which in turn makes it not CDI managed.
We then use a similar aproach to the one in DeltaSpike to create and return
@ApplicationScoped WINK handlers.

Regards
LF

On Thu, Jun 25, 2015 at 2:45 PM, Frank Langel <fr...@frankjlangel.com>
wrote:

> Hi Apache Wink team,
>
> I would like to execute some code just before the REST method is called
>
>    1. The code would access Http header parameters
>    2. I want to bind some information onto the thread that executes the
>    REST method using ThreadLocal
>
> Apache Wink is kind of old (latest post 2010)  and documentation hard to
> find
>
>    1. Has anyone build an interceptor similar to the one described
>    2. Has anyone experience
>    with org.apache.wink.server.handlers.HandlersFactory ? Can I use it for
>    this purpose?
>
> Thanks a lot in advance
> Frank
>
>


-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.