cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject cxf git commit: Allow overriding methodToInvoke selection in JAXRSInvoker
Date Mon, 01 Feb 2016 22:45:47 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 072aba653 -> abcc137cb


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/abcc137c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/abcc137c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/abcc137c

Branch: refs/heads/master
Commit: abcc137cb9b27e0da0b4270a18ac2a32df1e9990
Parents: 072aba6
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Mon Feb 1 23:33:05 2016 +0100
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Mon Feb 1 23:33:05 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/abcc137c/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);


Mime
View raw message