cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r686338 - in /cxf/branches/2.0.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
Date Fri, 15 Aug 2008 19:28:31 GMT
Author: dkulp
Date: Fri Aug 15 12:28:30 2008
New Revision: 686338

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

........
  r686237 | seanoc | 2008-08-15 10:32:48 -0400 (Fri, 15 Aug 2008) | 2 lines
  
  Fix so wsdl2java doesn't run out of memory when passed wsdl with large number of schemas.
  Modified WSDLServiceBuilder to correctly use schemaCache in WSDLManager
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 15 12:28:30 2008
@@ -1 +1 @@
-/cxf/trunk:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253
+/cxf/trunk:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Aug 15 12:28:30 2008
@@ -1 +1 @@
-/cxf/trunk:1-684881,684883-684884,684886-684888,684890-684892,684894-684923,685205,685253
+/cxf/trunk:1-684881,684883-684884,684886-684888,684890-684892,684894-684923,685205,685253,686237

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=686338&r1=686337&r2=686338&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Fri Aug 15 12:28:30 2008
@@ -227,7 +227,6 @@
             copyExtensors(description, def.getExtensibilityElements());
             copyExtensionAttributes(description, def);
         }
-
         for (Port port : cast(serv.getPorts().values(), Port.class)) {
             Binding binding = port.getBinding();
             PortType bindingPt = binding.getPortType();
@@ -244,24 +243,8 @@
                 description.getDescribed().add(service);
                 service.setProperty(WSDL_DEFINITION, def);
                 service.setProperty(WSDL_SERVICE, serv);
-                WSDLManager wsdlManager = bus.getExtension(WSDLManager.class); 
-                ServiceSchemaInfo serviceSchemaInfo = null;
-                if (wsdlManager != null) {
-                    serviceSchemaInfo = wsdlManager.getSchemasForDefinition(def);
-                }
+                getSchemas(def, service);
                 
-                if (serviceSchemaInfo != null) {
-                    service.setServiceSchemaInfo(serviceSchemaInfo);
-                } else {
-                    getSchemas(def, service);
-                    if (wsdlManager != null) {
-                        serviceSchemaInfo = new ServiceSchemaInfo();
-                        serviceSchemaInfo.setSchemaCollection(service.getXmlSchemaCollection());
-                        serviceSchemaInfo.setSchemaInfoList(service.getSchemas());
-                        wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
-                    }
-                }
-
                 service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
                 service.setTargetNamespace(def.getTargetNamespace());
                 service.setName(serv.getQName());
@@ -282,13 +265,31 @@
 
         return new ArrayList<ServiceInfo>(services.values());
     }
-
+ 
+    
     private void getSchemas(Definition def, ServiceInfo serviceInfo) {
-        SchemaUtil schemaUtil = new SchemaUtil(bus, this.schemaList);
-        schemaUtil.setCatalogResolvedMap(this.catalogResolvedMap);
-        schemaUtil.getSchemas(def, serviceInfo);
+        ServiceSchemaInfo serviceSchemaInfo = null;
+        WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
+        if (wsdlManager != null) {
+            serviceSchemaInfo = wsdlManager.getSchemasForDefinition(def);
+        }
+        
+        if (serviceSchemaInfo == null) {
+            SchemaUtil schemaUtil = new SchemaUtil(bus, this.schemaList);
+            schemaUtil.setCatalogResolvedMap(this.catalogResolvedMap);
+            schemaUtil.getSchemas(def, serviceInfo);
+            serviceSchemaInfo = new ServiceSchemaInfo();
+            serviceSchemaInfo.setSchemaCollection(serviceInfo.getXmlSchemaCollection());
+            serviceSchemaInfo.setSchemaInfoList(serviceInfo.getSchemas());
+            if (wsdlManager != null) {
+                wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
+            }
+        } else {
+            serviceInfo.setServiceSchemaInfo(serviceSchemaInfo);
+        }
     }
 
+
     private void parseImports(Definition def, List<Definition> defList) {
         List<Import> importList = new ArrayList<Import>();
 

Modified: cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java?rev=686338&r1=686337&r2=686338&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
(original)
+++ cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
Fri Aug 15 12:28:30 2008
@@ -84,7 +84,6 @@
         
         WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(this.bus);
         wsdlDefinition = builder.build(wsdlURL);
-        mgr.removeDefinition(wsdlDefinition);
         context.put(Bus.class, bus);
         context.put(ToolConstants.IMPORTED_DEFINITION, builder.getImportedDefinitions());
         checkSupported(wsdlDefinition);
@@ -108,7 +107,9 @@
     }
 
     public void customize() {
+        WSDLManager mgr = bus.getExtension(WSDLManager.class);
         if (!context.containsKey(ToolConstants.CFG_BINDING)) {
+            mgr.removeDefinition(wsdlDefinition);
             return;
         }
         cusParser = new CustomizationParser();
@@ -117,8 +118,12 @@
         jaxbBindings = cusParser.getJaxbBindings();
         handlerChain = cusParser.getHandlerChains();
 
+
         context.setJaxbBindingFiles(jaxbBindings);
         context.put(ToolConstants.HANDLER_CHAIN, handlerChain);
+        
+        
+        
         try {
             this.wsdlDefinition = buildCustomizedDefinition();
         } catch (Exception e) {
@@ -127,6 +132,9 @@
                                      (String)context.get(ToolConstants.CFG_WSDLURL));
             throw new RuntimeException(msg.toString(), e);
         }
+        
+        mgr.removeDefinition(wsdlDefinition); 
+
     }
 
     private void checkSupported(Definition def) throws ToolException {



Mime
View raw message