cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1034047 - in /cxf/branches/2.2.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:56:07 GMT
Author: sergeyb
Date: Thu Nov 11 18:56:06 2010
New Revision: 1034047

URL: http://svn.apache.org/viewvc?rev=1034047&view=rev
Log:
Merged revisions 1034045 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes

................
  r1034045 | sergeyb | 2010-11-11 18:53:20 +0000 (Thu, 11 Nov 2010) | 9 lines
  
  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.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 11 18:56:06 2010
@@ -1,2 +1,2 @@
-/cxf/branches/2.3.x-fixes:1027513,1027608,1030055,1030193
-/cxf/trunk:1027509,1027599,1030053,1030189
+/cxf/branches/2.3.x-fixes:1027513,1027608,1030055,1030193,1034045
+/cxf/trunk:1027509,1027599,1030053,1030189,1034035

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java?rev=1034047&r1=1034046&r2=1034047&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/AnnotationUtils.java
Thu Nov 11 18:56:06 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.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties?rev=1034047&r1=1034046&r2=1034047&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/Messages.properties
Thu Nov 11 18:56:06 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