users@jersey.java.net

[Jersey] Re: how to use custom injection annotation

From: ÕÅÁ¢öÎ <intelligentcodemail_at_gmail.com>
Date: Wed, 24 Sep 2014 04:11:04 +0800

I want to custom seems request scope like jersey requestScope on tyus,how
to do?now, i use child service serviceLocator. how to hold web socket long
session thread safe at session object



2014-09-24 3:32 GMT+08:00 Marek Potociar <marek.potociar_at_oracle.com>:

> Well, you cannot, unless your object is a JAX-RS resource...
>
> Marek
>
> On 23 Sep 2014, at 21:29, å¼ ç«‹é‘« <intelligentcodemail_at_gmail.com> wrote:
>
> I want to use @Context annotation on my object
>
>
>
> 2014-09-24 3:26 GMT+08:00 Marek Potociar <marek.potociar_at_oracle.com>:
>
>> I guess you want to send your question to WebSocket/Tyrus project mailing
>> list instead.
>>
>> Marek
>>
>> On 21 Sep 2014, at 17:57, å¼ ç«‹é‘« <intelligentcodemail_at_gmail.com> wrote:
>>
>> how to use custom injection annotation and use @Context inject?
>>
>> my code repo at
>> https://github.com/intelligentcode/ameba/tree/master/src/main/java/ameba/websocket
>>
>> binder at
>> https://github.com/intelligentcode/ameba/blob/master/src/main/java/ameba/websocket/internal/ParameterInjectionBinder.java
>>
>> i use new child serviceLocator way at
>>
>> https://github.com/intelligentcode/ameba/blob/master/src/main/java/ameba/websocket/internal/EndpointDelegate.java
>>
>> i want to use @Context in field and @QueryString in filed
>>
>> e.g.
>>
>> @PathParam("sub") //work well
>> String subPath1;
>> @QueryString // don't work
>> String qus;
>>
>> @Context // don't work
>> MessageState messageState;
>>
>> @WebSocket
>> @Path("websocket/async/{sub}")
>> public String asyncWebSocket1(String msg, boolean last,
>> // work well
>> @PathParam("sub") String subPath,
>> // work well
>>
>> @javax.websocket.server.PathParam("sub") String subPath1, // work well
>> @QueryString String qs) {
>> // work well
>>
>> return "msg:" + msg + ",last:" + last + ",path:" + subPath;
>> }
>>
>>
>>
>>
>
>