cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Making it easier to check if a given JAXRS operation is async
Date Tue, 11 Aug 2015 12:48:58 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 134a8c876 -> 7523f6f9e


Making it easier to check if a given JAXRS operation is async


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

Branch: refs/heads/3.0.x-fixes
Commit: 7523f6f9ec2ce87bb838c5ca6a2f897ef65edf9c
Parents: 134a8c8
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Aug 11 13:45:08 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Aug 11 13:48:34 2015 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/model/OperationResourceInfo.java   | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7523f6f9/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
index 9889084..181243b 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
@@ -30,6 +30,7 @@ import javax.ws.rs.Consumes;
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.Encoded;
 import javax.ws.rs.Produces;
+import javax.ws.rs.container.Suspended;
 import javax.ws.rs.core.MediaType;
 
 import org.apache.cxf.jaxrs.ext.Oneway;
@@ -48,7 +49,8 @@ public class OperationResourceInfo {
     private boolean encoded;
     private String defaultParamValue;
     private List<Parameter> parameters;
-    private boolean oneway; 
+    private boolean oneway;
+    private boolean async;
     private Set<String> nameBindings = new LinkedHashSet<String>();
     private Class<?>[] actualInParamTypes;
     private Type[] actualInGenericParamTypes;
@@ -70,6 +72,7 @@ public class OperationResourceInfo {
         this.defaultParamValue = ori.defaultParamValue;
         this.parameters = ori.parameters;
         this.oneway = ori.oneway;
+        this.async = ori.async;
         this.classResourceInfo = cri;
         this.nameBindings = ori.nameBindings;
         initActualMethodProperties();
@@ -87,6 +90,7 @@ public class OperationResourceInfo {
         checkEncoded();
         checkDefaultParameterValue();
         checkOneway();
+        checkSuspended();
         initActualMethodProperties();
     }
     
@@ -154,10 +158,23 @@ public class OperationResourceInfo {
             oneway = AnnotationUtils.getAnnotation(annotatedMethod.getAnnotations(), Oneway.class)
!= null;
         }
     }
+    private void checkSuspended() {
+        if (annotatedMethod != null) {
+            for (Annotation[] anns : annotatedMethod.getParameterAnnotations()) {
+                if (AnnotationUtils.getAnnotation(anns, Suspended.class) != null) {
+                    async = true;
+                    break;
+                }
+            }
+        }
+    }
 
     public boolean isOneway() {
         return oneway;
     }
+    public boolean isAsync() {
+        return async;
+    }
     
     public List<Parameter> getParameters() {
         return parameters;


Mime
View raw message