cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r590489 - in /incubator/cxf/trunk/rt/frontend: jaxws/src/main/java/org/apache/cxf/jaxws/ jaxws/src/main/java/org/apache/cxf/jaxws/support/ simple/src/main/java/org/apache/cxf/frontend/ simple/src/main/java/org/apache/cxf/service/factory/ si...
Date Tue, 30 Oct 2007 22:05:53 GMT
Author: dkulp
Date: Tue Oct 30 15:05:51 2007
New Revision: 590489

URL: http://svn.apache.org/viewvc?rev=590489&view=rev
Log:
Some refactoring to allow not creating ReflectionServiceFactory that get's overwritten by
the jaxws verison when using jaxws.
Updates to allow controlling whether generated schema is qualified or not.
Updates to allow controlling if wrapper types are anonymous or not.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/simple/SimpleServiceBuilder.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -33,7 +33,7 @@
 
 
     public JaxWsClientFactoryBean() {
-        setServiceFactory(new JaxWsServiceFactoryBean());
+        super(new JaxWsServiceFactoryBean());
     }
     
     @Override

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -61,10 +61,9 @@
     
     public JaxWsServerFactoryBean() {
         this(new JaxWsServiceFactoryBean());
-        doInit = true;
     }
     public JaxWsServerFactoryBean(JaxWsServiceFactoryBean serviceFactory) {
-        setServiceFactory(serviceFactory);
+        super(serviceFactory);
         
         JaxWsSoapBindingConfiguration defConfig 
             = new JaxWsSoapBindingConfiguration(serviceFactory);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -77,6 +77,10 @@
 
     public JaxWsServiceFactoryBean() {
         getIgnoredClasses().add(Service.class.getName());
+        
+        //the JAXWS-RI doesn't qualify the schemas for the wrapper types
+        //and thus won't work if we do.
+        setQualifyWrapperSchema(false);
     }
 
     public JaxWsServiceFactoryBean(JaxWsImplementorInfo implInfo) {
@@ -102,13 +106,6 @@
 
     protected SimpleMethodDispatcher getMethodDispatcher() {
         return methodDispatcher;
-    }
-
-    @Override
-    protected boolean qualifyWrapperSchema() {
-        //the JAXWS-RI doesn't qualify the schemas for the wrapper types
-        //and thus won't work if we do.
-        return false;
     }
 
     @Override

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractServiceFactory.java
Tue Oct 30 15:05:51 2007
@@ -21,10 +21,19 @@
 import java.io.File;
 
 import org.apache.cxf.service.ServiceBuilder;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.ServiceInfo;
 
 public abstract class AbstractServiceFactory extends AbstractWSDLBasedEndpointFactory implements
     ServiceBuilder {
+    
+    protected AbstractServiceFactory() {
+        super();
+    }
+    protected AbstractServiceFactory(ReflectionServiceFactoryBean sbean) {
+        super(sbean);
+    }
+    
     public ServiceInfo createService() {
         try {
             return createEndpoint().getEndpointInfo().getService();

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
Tue Oct 30 15:05:51 2007
@@ -50,6 +50,12 @@
     private Class serviceClass;
     private ReflectionServiceFactoryBean serviceFactory;
     
+    protected AbstractWSDLBasedEndpointFactory(ReflectionServiceFactoryBean sbean) {
+        serviceFactory = sbean;
+    }
+    protected AbstractWSDLBasedEndpointFactory() {
+    }
+    
     protected Endpoint createEndpoint() throws BusException, EndpointException {
         Service service = serviceFactory.getService();
         

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -35,9 +35,10 @@
     private Client client;
     
     public ClientFactoryBean() {
-        super();
-        setServiceFactory(new ReflectionServiceFactoryBean());
-        
+        this(new ReflectionServiceFactoryBean());
+    }
+    public ClientFactoryBean(ReflectionServiceFactoryBean factory) { 
+        super(factory);
     }
 
     public Client create() {

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -88,9 +88,10 @@
     private Invoker invoker;
     
     public ServerFactoryBean() {
-        super();
-        setServiceFactory(new ReflectionServiceFactoryBean());
-        
+        this(new ReflectionServiceFactoryBean());       
+    }
+    public ServerFactoryBean(ReflectionServiceFactoryBean sbean) {
+        super(sbean);
     }
     
     public String getBeanName() {

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue Oct 30 15:05:51 2007
@@ -130,6 +130,8 @@
     private Map<String, Object> properties;
     private QName endpointName;
     private boolean populateFromClass;
+    private boolean anonymousWrappers;
+    private boolean qualifiedSchemas = true;
 
 
     public ReflectionServiceFactoryBean() {
@@ -526,7 +528,7 @@
         }
         SchemaInfo si = getOrCreateSchema(serviceInfo, 
                                           mpi.getElementQName().getNamespaceURI(),
-                                          qualifyWrapperSchema());
+                                          getQualifyWrapperSchema());
         XmlSchema schema = si.getSchema();
 
         XmlSchemaElement el = new XmlSchemaElement();
@@ -543,16 +545,35 @@
         el.setSchemaTypeName(tp.getQName());
     }
 
-
-    protected boolean qualifyWrapperSchema() {
-        return true;
+    public boolean getAnonymousWrapperTypes() {
+        return anonymousWrappers;
+    }
+    public boolean isAnonymousWrapperTypes() {
+        return anonymousWrappers;
+    }
+    public void setAnonymousWrapperTypes(boolean b) {
+        anonymousWrappers = b;
+    }
+    
+    public boolean getQualifyWrapperSchema() {
+        return qualifiedSchemas;
+    }
+    public boolean isQualifyWrapperSchema() {
+        return qualifiedSchemas;
     }
+    public void setQualifyWrapperSchema(boolean b) {
+        qualifiedSchemas = b;
+    }
+    
+    
 
+    
+    
     protected void createWrappedSchema(ServiceInfo serviceInfo, AbstractMessageContainer
wrappedMessage,
                                        AbstractMessageContainer unwrappedMessage, QName wrapperBeanName)
{
         SchemaInfo schemaInfo = getOrCreateSchema(serviceInfo,
                                                   wrapperBeanName.getNamespaceURI(),
-                                                  qualifyWrapperSchema());
+                                                  getQualifyWrapperSchema());
 
         createWrappedMessageSchema(serviceInfo, wrappedMessage, unwrappedMessage,
                                    schemaInfo.getSchema(), wrapperBeanName);
@@ -705,11 +726,15 @@
         wrappedMessage.getMessageParts().get(0).setXmlSchema(el);
 
         XmlSchemaComplexType ct = new XmlSchemaComplexType(schema);
-        ct.setName(wrapperName.getLocalPart());
-        el.setSchemaTypeName(wrapperName);
+        
+        if (!isAnonymousWrapperTypes()) {
+            ct.setName(wrapperName.getLocalPart());
+            el.setSchemaTypeName(wrapperName);
+            schema.addType(ct);
+            schema.getItems().add(ct);
+        }
         el.setSchemaType(ct);
-        schema.addType(ct);
-        schema.getItems().add(ct);
+
 
         XmlSchemaSequence seq = new XmlSchemaSequence();
         ct.setParticle(seq);
@@ -783,7 +808,7 @@
 
                 SchemaInfo headerSchemaInfo = getOrCreateSchema(serviceInfo, 
                                                                 qn.getNamespaceURI(),
-                                                                qualifyWrapperSchema());
+                                                                getQualifyWrapperSchema());
                 if (!isExistSchemaElement(headerSchemaInfo.getSchema(), qn)) {
                     headerSchemaInfo.getSchema().getItems().add(el);
                 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/simple/SimpleServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/simple/SimpleServiceBuilder.java?rev=590489&r1=590488&r2=590489&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/simple/SimpleServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/simple/SimpleServiceBuilder.java
Tue Oct 30 15:05:51 2007
@@ -25,7 +25,6 @@
 public class SimpleServiceBuilder extends AbstractServiceFactory {
     
     public SimpleServiceBuilder() {
-        super();
-        setServiceFactory(new ReflectionServiceFactoryBean());
+        super(new ReflectionServiceFactoryBean());
     }
 }



Mime
View raw message