cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating OAuthInvoker
Date Tue, 24 Nov 2015 12:21:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 6cb698081 -> c0fd11fa0


Updating OAuthInvoker


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c0fd11fa
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c0fd11fa
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c0fd11fa

Branch: refs/heads/3.1.x-fixes
Commit: c0fd11fa058c0422d84e67b9e45233010cc55f7f
Parents: 6cb6980
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Nov 24 12:18:49 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Nov 24 12:21:20 2015 +0000

----------------------------------------------------------------------
 .../cxf/rs/security/oauth2/client/OAuthInvoker.java    | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c0fd11fa/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthInvoker.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthInvoker.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthInvoker.java
index 1b8aa72..6775b4b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthInvoker.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthInvoker.java
@@ -18,9 +18,11 @@
  */
 package org.apache.cxf.rs.security.oauth2.client;
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 import javax.ws.rs.NotAuthorizedException;
 
-import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxrs.JAXRSInvoker;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -33,10 +35,11 @@ public class OAuthInvoker extends JAXRSInvoker {
     private WebClient accessTokenServiceClient;
     private Consumer consumer;
     @Override
-    public Object invoke(Exchange exchange, Object requestParams, Object resourceObject)
{
+    protected Object performInvocation(Exchange exchange, final Object serviceObject, Method
m,
+                                       Object[] paramArray) throws Exception {
         try {
-            return super.invoke(exchange, requestParams, resourceObject);
-        } catch (Fault ex) {
+            return super.performInvocation(exchange, serviceObject, m, paramArray);
+        } catch (InvocationTargetException ex) {
             if (ex.getCause() instanceof NotAuthorizedException) {
                 Message inMessage = exchange.getInMessage();
                 ClientTokenContext tokenContext = inMessage.getContent(ClientTokenContext.class);
@@ -53,7 +56,7 @@ public class OAuthInvoker extends JAXRSInvoker {
                     contextManager.setClientTokenContext(mc, tokenContext);
                     
                     //retry
-                    return super.invoke(exchange, requestParams, resourceObject);
+                    return super.performInvocation(exchange, serviceObject, m, paramArray);
                 }
             }
             throw ex;


Mime
View raw message