cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r953781 - in /cxf/branches/2.2.x-fixes: ./ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/ tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/ tools/javato/ws/src/main/java/org/apache/cxf/tools/java...
Date Fri, 11 Jun 2010 17:28:59 GMT
Author: dkulp
Date: Fri Jun 11 17:28:58 2010
New Revision: 953781

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

........
  r950855 | dkulp | 2010-06-02 22:03:18 -0400 (Wed, 02 Jun 2010) | 2 lines
  
  Work toward making the codegen plugin threadsafe to work with Maven 3's
  parrallel mode.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
    cxf/branches/2.2.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToProcessor.java
    cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
    cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
    cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
    cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
    cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java

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

Modified: cxf/branches/2.2.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
(original)
+++ cxf/branches/2.2.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
Fri Jun 11 17:28:58 2010
@@ -354,9 +354,13 @@ public class WSDL2JavaMojo extends Abstr
         ClassLoaderSwitcher classLoaderSwitcher = new ClassLoaderSwitcher(getLog());
         boolean result = true;
 
+        Bus bus = null;
         try {
             classLoaderSwitcher.switchClassLoader(project, useCompileClasspath, classesDir);
 
+            bus = BusFactory.newInstance().createBus();
+            BusFactory.setThreadDefaultBus(bus);
+
             for (WsdlOption o : effectiveWsdlOptions) {
                 callWsdl2Java(o);
 
@@ -369,12 +373,10 @@ public class WSDL2JavaMojo extends Abstr
             }
         } finally {
             // cleanup as much as we can.
-            Bus bus = BusFactory.getDefaultBus(false);
             if (bus != null) {
                 bus.shutdown(true);
             }
             classLoaderSwitcher.restoreClassLoader();
-            org.apache.cxf.tools.wsdlto.core.PluginLoader.unload();
         }
         if (project != null && sourceRoot != null && sourceRoot.exists())
{
             project.addCompileSourceRoot(sourceRoot.getAbsolutePath());

Modified: cxf/branches/2.2.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToProcessor.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToProcessor.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToProcessor.java
Fri Jun 11 17:28:58 2010
@@ -57,7 +57,7 @@ public class WSDLToProcessor implements 
 
     public void parseWSDL(String wsdlUrl) {
         try {           
-            Bus bus = BusFactory.getDefaultBus();
+            Bus bus = BusFactory.getThreadDefaultBus();
             WSDLManager mgr = bus.getExtension(WSDLManager.class);
             wsdlDefinition = mgr.getDefinition(wsdlUrl);
             WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);

Modified: cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessor.java
Fri Jun 11 17:28:58 2010
@@ -296,7 +296,7 @@ public class JavaToJSProcessor implement
     }
 
     public Bus getBus() {
-        return BusFactory.getDefaultBus();
+        return BusFactory.getThreadDefaultBus();
     }
 
     public void setEnvironment(ToolContext env) {

Modified: cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.java
Fri Jun 11 17:28:58 2010
@@ -337,7 +337,7 @@ public class JavaToWSDLProcessor impleme
     }
 
     public Bus getBus() {
-        return BusFactory.getDefaultBus();
+        return BusFactory.getThreadDefaultBus();
     }
 
     public void setEnvironment(ToolContext env) {

Modified: cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidatorUtil.java
Fri Jun 11 17:28:58 2010
@@ -60,7 +60,7 @@ public final class ValidatorUtil {
 
     public static SchemaCollection getSchema(final Definition def) {
         ServiceInfo serviceInfo = new ServiceInfo();
-        new SchemaUtil(BusFactory.getDefaultBus(), 
+        new SchemaUtil(BusFactory.getThreadDefaultBus(), 
                        new HashMap<String, Element>()).getSchemas(def, 
                                                                   serviceInfo);
         return serviceInfo.getXmlSchemaCollection();

Modified: cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
Fri Jun 11 17:28:58 2010
@@ -66,7 +66,7 @@ public class WSDL11Validator extends Abs
     }
 
     public WSDL11Validator(final Definition definition, final ToolContext pe) {
-        this(definition, pe, BusFactory.getDefaultBus());
+        this(definition, pe, BusFactory.getThreadDefaultBus());
     }
 
     public WSDL11Validator(final Definition definition, final ToolContext pe, final Bus b)
{

Modified: cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
Fri Jun 11 17:28:58 2010
@@ -98,7 +98,7 @@ public class WSDLRefValidator extends Ab
     private boolean suppressWarnings;
 
     public WSDLRefValidator(Definition wsdl, Document doc) {
-        this(wsdl, doc, BusFactory.getDefaultBus());
+        this(wsdl, doc, BusFactory.getThreadDefaultBus());
     }
 
     public WSDLRefValidator(Definition wsdl, Document doc, Bus bus) {

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
Fri Jun 11 17:28:58 2010
@@ -45,7 +45,7 @@ public class WSDLToJava {
     private String[] args;
     private PrintStream out = System.out;
 
-    private PluginLoader pluginLoader = PluginLoader.getInstance();
+    private PluginLoader pluginLoader = PluginLoader.newInstance();
 
     public WSDLToJava() {
         args = new String[0];

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
Fri Jun 11 17:28:58 2010
@@ -66,17 +66,10 @@ public final class PluginLoader {
 
     private Unmarshaller unmarshaller;
 
-    private ClassLoader classLoader = getClass().getClassLoader();
-
     private PluginLoader() {
         init();
     }
 
-    private PluginLoader(final ClassLoader l) {
-        this.classLoader = l;
-        init();
-    }
-
     private void init() {
         try {
             JAXBContext jc = JAXBContext.newInstance("org.apache.cxf.tools.plugin");
@@ -97,14 +90,6 @@ public final class PluginLoader {
         init();
     }
 
-    public void setClassLoader(final ClassLoader l) {
-        this.classLoader = l;
-    }
-
-    public ClassLoader getClassLoader() {
-        return this.classLoader;
-    }
-
     private void loadPlugins(List<URL> pluginFiles) throws IOException {
         if (pluginFiles == null) {
             LOG.log(Level.WARNING, "FOUND_NO_PLUGINS");
@@ -115,7 +100,9 @@ public final class PluginLoader {
             loadPlugin(url);
         }
     }
-
+    public static PluginLoader newInstance() {
+        return new PluginLoader();
+    }
     public static PluginLoader getInstance() {
         if (pluginLoader == null) {
             pluginLoader = new PluginLoader();
@@ -123,13 +110,6 @@ public final class PluginLoader {
         return pluginLoader;
     }
 
-    public static PluginLoader getInstance(final ClassLoader cl) {
-        if (pluginLoader == null) {
-            pluginLoader = new PluginLoader(cl);
-        }
-        return pluginLoader;
-    }
-
     public static void unload() {
         pluginLoader = null;
     }
@@ -281,7 +261,7 @@ public final class PluginLoader {
         try {
             for (Generator generator : frontend.getGenerators().getGenerator()) {
                 fullClzName = getGeneratorClass(frontend, generator);
-                Class clz = this.classLoader.loadClass(fullClzName);
+                Class clz = ClassLoaderUtils.loadClass(fullClzName, this.getClass());
                 generators.add((FrontEndGenerator)clz.newInstance());
             }
         } catch (Exception e) {
@@ -296,7 +276,7 @@ public final class PluginLoader {
     private FrontEndProfile loadFrontEndProfile(String fullClzName) {
         FrontEndProfile profile = null;
         try {
-            Class clz = this.classLoader.loadClass(fullClzName);
+            Class clz = ClassLoaderUtils.loadClass(fullClzName, this.getClass());
             profile = (FrontEndProfile)clz.newInstance();
         } catch (Exception e) {
             Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/javascript/src/main/java/org/apache/cxf/tools/wsdlto/javascript/JavaScriptContainer.java
Fri Jun 11 17:28:58 2010
@@ -90,7 +90,7 @@ public class JavaScriptContainer extends
         if (serviceList == null) {
             serviceList = new ArrayList<ServiceInfo>();
 
-            PluginLoader pluginLoader = PluginLoader.getInstance();
+            PluginLoader pluginLoader = PluginLoader.newInstance();
             // for JavaScript generation, we always use JAX-WS.
             FrontEndProfile frontend = pluginLoader.getFrontEndProfile("jaxws");
 

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java?rev=953781&r1=953780&r2=953781&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/AbstractWSDLToProcessor.java
Fri Jun 11 17:28:58 2010
@@ -110,7 +110,7 @@ public class AbstractWSDLToProcessor imp
     protected void parseWSDL(String wsdlURL) throws ToolException {
         Bus bus = env.get(Bus.class);
         if (bus == null) {
-            bus = BusFactory.getDefaultBus();
+            bus = BusFactory.getThreadDefaultBus();
             env.put(Bus.class, bus);
         }
         WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(bus);



Mime
View raw message