cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1034045 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
Date Thu, 11 Nov 2010 18:53:21 GMT
Author: sergeyb
Date: Thu Nov 11 18:53:20 2010
New Revision: 1034045

URL: http://svn.apache.org/viewvc?rev=1034045&view=rev
Log:
Merged revisions 1034035 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1034035 | sergeyb | 2010-11-11 18:44:12 +0000 (Thu, 11 Nov 2010) | 1 line
  
  Making sure no servlet api is strictly required on the client side
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 11 18:53:20 2010
@@ -1 +1 @@
-/cxf/trunk:1022599-1022884,1027274,1027462,1027509,1027553,1027599,1030053,1030189,1032296,1032833
+/cxf/trunk:1022599-1022884,1027274,1027462,1027509,1027553,1027599,1030053,1030189,1032296,1032833,1034035

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov 11 18:53:20 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022599-1022884,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599,1028170,1029943,1030053,1030189,1032296,1032833
+/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022599-1022884,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599,1028170,1029943,1030053,1030189,1032296,1032833,1034035

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java?rev=1034045&r1=1034044&r2=1034045&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
Thu Nov 11 18:53:20 2010
@@ -22,7 +22,9 @@ package org.apache.cxf.jaxrs.utils;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.HashSet;
+import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.logging.Logger;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -47,10 +49,15 @@ import javax.ws.rs.core.UriInfo;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Providers;
 
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.jaxrs.ext.MessageContext;
 
 public final class AnnotationUtils {
     
+    private static final Logger LOG = LogUtils.getL7dLogger(AnnotationUtils.class);
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AnnotationUtils.class);
+
     private static final Set<Class> CONTEXT_CLASSES;
     private static final Set<Class> PARAM_ANNOTATION_CLASSES;
     private static final Set<Class> METHOD_ANNOTATION_CLASSES;
@@ -73,10 +80,19 @@ public final class AnnotationUtils {
         classes.add(ContextResolver.class);
         classes.add(Providers.class);
         classes.add(Request.class);
-        classes.add(HttpServletRequest.class);
-        classes.add(HttpServletResponse.class);
-        classes.add(ServletConfig.class);
-        classes.add(ServletContext.class);
+        // Servlet API
+        try {
+            classes.add(HttpServletRequest.class);
+            classes.add(HttpServletResponse.class);
+            classes.add(ServletConfig.class);
+            classes.add(ServletContext.class);
+        } catch (Exception ex) {
+            // it is not a problem on the client side and the exception will be
+            // thrown later on if the injection of one of these contexts will be 
+            // attempted on the server side
+            LOG.fine(new org.apache.cxf.common.i18n.Message("NO_SERVLET_API", 
+                                                            BUNDLE).toString());
+        }
         // CXF-specific
         classes.add(MessageContext.class);
         return classes;

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties?rev=1034045&r1=1034044&r2=1034045&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
Thu Nov 11 18:53:20 2010
@@ -18,6 +18,7 @@
 #    under the License.
 #
 #
+NO_SERVLET_API=No Java Servlet API is available on the runtime classpath
 NO_RESOURCE_OP_EXC=No resource methods have been found for resource class {0}
 GET_INSTEAD_OF_HEAD=Resource class {0} does not support HEAD http method, method {1} supporting
GET http method will be invoked
 NO_CONTENT_TYPE_SPECIFIED=No Content-Type specified for HTTP {0}



Mime
View raw message