cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r703501 - in /cxf/trunk/rt/frontend: jaxws/src/main/java/org/apache/cxf/jaxws/support/ simple/src/main/java/org/apache/cxf/service/factory/
Date Fri, 10 Oct 2008 15:36:02 GMT
Author: dkulp
Date: Fri Oct 10 08:36:02 2008
New Revision: 703501

URL: http://svn.apache.org/viewvc?rev=703501&view=rev
Log:
Log a warning if you use the Simple frontend with a class that has jaxws annotations on it.
  (sick of fielding support issues related to it)

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=703501&r1=703500&r2=703501&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Fri Oct 10 08:36:02 2008
@@ -174,6 +174,10 @@
         setJaxWsImplementorInfo(new JaxWsImplementorInfo(serviceClass));
         super.setServiceClass(getJaxWsImplementorInfo().getEndpointClass());
     }
+    @Override
+    protected void checkServiceClassAnnotations(Class<?> sc) {
+        //no need to check
+    }
 
     @Override
     protected void initializeDefaultInterceptors() {

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=703501&r1=703500&r2=703501&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Oct 10 08:36:02 2008
@@ -2048,6 +2048,35 @@
 
     public void setServiceClass(Class<?> serviceClass) {
         this.serviceClass = serviceClass;
+        checkServiceClassAnnotations(serviceClass);
+    }
+    protected void checkServiceClassAnnotations(Class<?> sc) {
+        Annotation anns[] = serviceClass.getAnnotations();
+        if (anns != null) {
+            for (Annotation ann : anns) {
+                String pkg = ann.annotationType().getPackage().getName(); 
+                if ("javax.xml.ws".equals(pkg)
+                    || "javax.jws".equals(pkg)) {
+                    
+                    LOG.log(Level.WARNING, "JAXWS_ANNOTATION_FOUND", serviceClass.getName());
+                    return;
+                }
+            }
+        }
+        for (Method m : serviceClass.getMethods()) {
+            anns = m.getAnnotations();
+            if (anns != null) {
+                for (Annotation ann : anns) {
+                    String pkg = ann.annotationType().getPackage().getName(); 
+                    if ("javax.xml.ws".equals(pkg)
+                        || "javax.jws".equals(pkg)) {
+                        
+                        LOG.log(Level.WARNING, "JAXWS_ANNOTATION_FOUND", serviceClass.getName());
+                        return;
+                    }
+                }
+            }
+        }
     }
 
     public String getWsdlURL() {

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=703501&r1=703500&r2=703501&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
Fri Oct 10 08:36:02 2008
@@ -30,4 +30,4 @@
   without the JAX-WS service factory bean.
 INTRACTABLE_PART= Message part {0} of Message {1} cannot be processed. This can be caused
by the use of JAX-WS-specific types \
  without the JAX-WS service factory bean.
- 
\ No newline at end of file
+JAXWS_ANNOTATION_FOUND=A JAX-WS Annotation was found on {0} while using the Simple frontend.
 For better results, use the JAX-WS frontend.
\ No newline at end of file



Mime
View raw message