[resteasy-dev] How to make (java) method available from ClientRequestContext?

Michael Musgrove mmusgrov at redhat.com
Fri Dec 14 10:24:09 EST 2018


Can you inject an instance of ResourceInfo, something like the following:

@Context
protected ResourceInfo resourceInfo;

public void filter(ClientRequestContext ctx) throws IOException {
    Method method = resourceInfo.getResourceMethod();
    ...
}

On Fri, Dec 14, 2018 at 2:37 PM Michal Szynkiewicz <mszynkie at redhat.com>
wrote:

> Hi,
>
> MicroProfile Rest Client 1.2 requires that the method that is handling the
> request is available under a specific key in the ClientRequestContext [1].
>
> I've been struggling to find an elegant way of implementing it in
> SmallRye. Currently, I have it working with a filter and digging out the
> ClientInvocation from ClientRequestContextImpl [2] but would rather not use
> reflection for that.
>
> Could you give me some tip how to implement it better, if possible?
>
> Thanks,
> Michał
>
> [1]
> https://github.com/eclipse/microprofile-rest-client/blob/857ce67949a1e84600e5ffa2dfc80571465aa31a/tck/src/main/java/org/eclipse/microprofile/rest/client/tck/providers/InvokedMethodRequestFilter.java#L36
>
> [2]
> https://github.com/michalszynkiewicz/smallrye-rest-client/blob/99e05e97932e5b53bb4161594950c3ef7dba9a2d/implementation/src/main/java/io/smallrye/restclient/MethodInjectionFilter.java#L34-L49
> _______________________________________________
> resteasy-dev mailing list
> resteasy-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/resteasy-dev
>


-- 
Michael Musgrove
mmusgrov at redhat.com

JBoss, by Red Hat
Registered Address: Red Hat Ltd, 6700 Cork Airport Business Park, Kinsale
Road, Co. Cork.
Registered in the Companies Registration Office, Parnell House, 14 Parnell
Square, Dublin 1, Ireland, No.304873
Directors:Michael Cunningham (USA), Vicky Wiseman (USA), Michael O'Neill,
Keith Phelan, Matt Parson (USA)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/resteasy-dev/attachments/20181214/d6e044ec/attachment.html 


More information about the resteasy-dev mailing list