Repository: cxf Updated Branches: refs/heads/3.1.x-fixes ad577419d -> f183b9f00
Allow overriding methodToInvoke selection in JAXRSInvoker Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1f44b234 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1f44b234 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1f44b234 Branch: refs/heads/3.1.x-fixes Commit: 1f44b234594e60f9604959cd2859f3970d3d4360 Parents: ad57741 Author: Alessio Soldano <[email protected]> Authored: Mon Feb 1 23:33:05 2016 +0100 Committer: Alessio Soldano <[email protected]> Committed: Mon Feb 1 23:47:25 2016 +0100 ---------------------------------------------------------------------- .../java/org/apache/cxf/jaxrs/JAXRSInvoker.java | 29 ++++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/1f44b234/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java index ad2c627..ac445d9 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java @@ -166,18 +166,7 @@ public class JAXRSInvoker extends AbstractInvoker { } - Method resourceMethod = cri.getMethodDispatcher().getMethod(ori); - - Method methodToInvoke = null; - if (Proxy.class.isInstance(resourceObject)) { - methodToInvoke = cri.getMethodDispatcher().getProxyMethod(resourceMethod); - if (methodToInvoke == null) { - methodToInvoke = InjectionUtils.checkProxy(resourceMethod, resourceObject); - cri.getMethodDispatcher().addProxyMethod(resourceMethod, methodToInvoke); - } - } else { - methodToInvoke = resourceMethod; - } + Method methodToInvoke = getMethodToInvoke(cri, ori, resourceObject); List<Object> params = null; if (request instanceof List) { @@ -290,6 +279,22 @@ public class JAXRSInvoker extends AbstractInvoker { setResponseContentTypeIfNeeded(inMessage, result); return result; } + + protected Method getMethodToInvoke(ClassResourceInfo cri, OperationResourceInfo ori, Object resourceObject) { + Method resourceMethod = cri.getMethodDispatcher().getMethod(ori); + + Method methodToInvoke = null; + if (Proxy.class.isInstance(resourceObject)) { + methodToInvoke = cri.getMethodDispatcher().getProxyMethod(resourceMethod); + if (methodToInvoke == null) { + methodToInvoke = InjectionUtils.checkProxy(resourceMethod, resourceObject); + cri.getMethodDispatcher().addProxyMethod(resourceMethod, methodToInvoke); + } + } else { + methodToInvoke = resourceMethod; + } + return methodToInvoke; + } private MessageContentsList checkExchangeForResponse(Exchange exchange) { Response r = exchange.get(Response.class);
