tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-1535 don't scan @Path on methods only to skip subresources
Date Mon, 30 Mar 2015 08:57:08 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 38184f38d -> 54221fff9


TOMEE-1535 don't scan @Path on methods only to skip subresources


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

Branch: refs/heads/master
Commit: 54221fff9b96e6a4e1f49742e9e6ce67f0e051ec
Parents: 38184f3
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Mon Mar 30 10:56:28 2015 +0200
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Mon Mar 30 10:56:28 2015 +0200

----------------------------------------------------------------------
 .../openejb/config/AnnotationDeployer.java      | 25 ++++++++++----------
 .../server/cxf/rs/CxfRsHttpListener.java        |  2 +-
 2 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/54221fff/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
index eda75e6..f4713bf 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
@@ -5552,20 +5552,21 @@ public class AnnotationDeployer implements DynamicDeployer {
             }
         }
 
-        // methods annotations: inheritance is managed like it to be more efficient
-        final List<Annotated<Method>> methods = finder.findMetaAnnotatedMethods(Path.class);
-        for (final Annotated<Method> aMethod : methods) {
-            final Method method = aMethod.get();
-            final Class<?> clazz = method.getDeclaringClass();
-
-            if (isInstantiable(clazz)) {
-                if (!isEJB(clazz)) {
+        if ("true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.jaxrs.scanning.methods",
"false"))) {
+            final List<Annotated<Method>> methods = finder.findMetaAnnotatedMethods(Path.class);
+            for (final Annotated<Method> aMethod : methods) {
+                final Method method = aMethod.get();
+                final Class<?> clazz = method.getDeclaringClass();
+
+                if (isInstantiable(clazz)) {
+                    if (!isEJB(clazz)) {
+                        classes.add(clazz.getName());
+                    } else {
+                        webModule.getEjbRestServices().add(clazz.getName());
+                    }
+                } else if (isEJB(clazz) && DynamicSubclass.isDynamic(clazz)) {
                     classes.add(clazz.getName());
-                } else {
-                    webModule.getEjbRestServices().add(clazz.getName());
                 }
-            } else if (isEJB(clazz) && DynamicSubclass.isDynamic(clazz)) {
-                classes.add(clazz.getName());
             }
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/54221fff/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
----------------------------------------------------------------------
diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
index 80ba49a..d9a1253 100644
--- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
+++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
@@ -437,7 +437,7 @@ public class CxfRsHttpListener implements RsHttpListener {
     }
 
     private static void addMandatoryProviders(final Collection<Object> instances) {
-        instances.add(new JsrProvider()); // is this one really mandatory?
+        instances.add(new JsrProvider());
         instances.add(new WadlDocumentMessageBodyWriter());
         instances.add(EJBAccessExceptionMapper.INSTANCE);
 


Mime
View raw message