[jbossws-commits] JBossWS SVN: r3509 - in branches/jbossws-2.0: integration/native/ant-import and 17 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Fri Jun 8 11:50:12 EDT 2007
Author: thomas.diesler at jboss.com
Date: 2007-06-08 11:50:12 -0400 (Fri, 08 Jun 2007)
New Revision: 3509
Added:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/utils/ServiceLoader.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJFactoryLoader.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/ProviderLoader.java
Removed:
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
Modified:
branches/jbossws-2.0/build/ant-import/build-testsuite.xml
branches/jbossws-2.0/integration/native/ant-import/macros-deploy-native.xml
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProvider.java
branches/jbossws-2.0/jbossws-core/.classpath
branches/jbossws-2.0/jbossws-core/ant-import/build-thirdparty.xml
branches/jbossws-2.0/jbossws-core/src/main/etc/component-info.xml
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/ServiceFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/addressing/AddressingBuilder.java
branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
branches/jbossws-2.0/jbossws-core/version.properties
Log:
[JBWS-1706] SOAPConnection.get fails with ProtocolException
SOAPElement.addTextNode does not add comment nodes
Remove dependency of saaj,jaxrpc,jaxws on SPI and jboss logging for usage with jdk1.6
Modified: branches/jbossws-2.0/build/ant-import/build-testsuite.xml
===================================================================
--- branches/jbossws-2.0/build/ant-import/build-testsuite.xml 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/build/ant-import/build-testsuite.xml 2007-06-08 15:50:12 UTC (rev 3509)
@@ -116,6 +116,7 @@
<pathelement location="${jboss.client}/javassist.jar"/>
<pathelement location="${jboss.client}/jaxb-xjc.jar"/>
<pathelement location="${jboss.client}/jboss-jboss50.jar"/>
+ <pathelement location="${jboss.client}/jboss-remoting.jar"/>
<pathelement location="${jboss.client}/jbossws-jboss50.jar"/>
<pathelement location="${jboss.client}/jbossall-client.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
Modified: branches/jbossws-2.0/integration/native/ant-import/macros-deploy-native.xml
===================================================================
--- branches/jbossws-2.0/integration/native/ant-import/macros-deploy-native.xml 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/integration/native/ant-import/macros-deploy-native.xml 2007-06-08 15:50:12 UTC (rev 3509)
@@ -146,19 +146,27 @@
<sequential>
<fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
+ <!-- ENDORSED -->
+ <copy todir="${jboss42.home}/lib/endorsed" overwrite="true">
+ <fileset dir="@{thirdpartylibs}">
+ <include name="jaxb-api.jar"/>
+ </fileset>
+ <fileset dir="@{corelibs}">
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-jaxws.jar"/>
+ <include name="jboss-saaj.jar"/>
+ </fileset>
+ </copy>
+
<!-- CLIENT JARS -->
<copy todir="${jboss42.home}/client" overwrite="true">
<fileset dir="@{jbosslibs}">
<include name="jbossws-jboss42.jar"/>
</fileset>
<fileset dir="@{corelibs}">
- <include name="jboss-jaxrpc.jar"/>
- <include name="jboss-jaxws.jar"/>
- <include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
</fileset>
<fileset dir="@{thirdpartylibs}">
- <include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
<include name="wsdl4j.jar"/>
@@ -168,16 +176,11 @@
</fileset>
</copy>
- <!-- SERVER JARS -->
+ <!-- SERVER JARS -->
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
<fileset dir="@{jbosslibs}">
<include name="jbossws-jboss42.jar"/>
</fileset>
- <fileset dir="@{corelibs}">
- <include name="jboss-jaxrpc.jar"/>
- <include name="jboss-jaxws.jar"/>
- <include name="jboss-saaj.jar"/>
- </fileset>
</copy>
<mkdir dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
@@ -204,6 +207,11 @@
<fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
<delete>
+ <!-- ENDORSED -->
+ <fileset dir="${jboss42.home}/lib/endorsed">
+ <include name="jaxb-api.jar"/>
+ </fileset>
+
<!-- CLIENT JARS -->
<fileset dir="${jboss42.home}/client">
<include name="jaxb-api.jar"/>
@@ -223,6 +231,9 @@
</fileset>
<!-- SERVER JARS -->
+ <fileset dir="${jboss42.home}/lib/endorsed">
+ <include name="jaxb-api.jar"/>
+ </fileset>
<fileset dir="${jboss42.home}/lib">
<!-- Remove only, do not deploy -->
<include name="jbossws-integration.jar"/>
Deleted: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -1,194 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.integration;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-
-// $Id$
-
-/**
- * Load a factory using this ordered lookup procedure
- *
- * <ol>
- * <li>Use the system property
- * <li>Use the properties file "lib/jaxm.properties" in the JRE directory
- * <li>Use the Services API (as detailed in the JAR specification), if available, to determine the classname
- * <li>Use the default factory implementation class
- * </ol>
- *
- * @author Thomas.Diesler at jboss.com
- * @since 14-Dec-2006
- */
-public class FactoryLoader
-{
- private FactoryLoader()
- {
- }
-
- /**
- *
- * @return the factory impl, or null
- */
- public static Object loadFactory(String propertyName, String defaultFactory)
- {
- Object factory = null;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- // Use the system property
- PrivilegedAction action = new PropertyAccessAction(propertyName);
- String factoryName = (String)AccessController.doPrivileged(action);
- if (factoryName != null)
- {
- try
- {
- //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
-
- // Use the properties file "lib/jaxm.properties" in the JRE directory.
- // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
- if (factory == null)
- {
- action = new PropertyAccessAction("java.home");
- String javaHome = (String)AccessController.doPrivileged(action);
- File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
- if (jaxmFile.exists())
- {
- try
- {
- action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
- Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
- factoryName = jaxmProperties.getProperty(propertyName);
- if (factoryName != null)
- {
- //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
- }
-
- // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
- if (factory == null)
- {
- String filename = "META-INF/services/" + propertyName;
- InputStream inStream = loader.getResourceAsStream(filename);
- if (inStream != null)
- {
- try
- {
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
- factoryName = br.readLine();
- br.close();
- if (factoryName != null)
- {
- //if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
- }
-
- // Use the default factory implementation class.
- if (factory == null && defaultFactory != null)
- {
- try
- {
- factoryName = defaultFactory;
- //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
- Class factoryClass = loader.loadClass(factoryName);
- factory = factoryClass.newInstance();
- }
- catch (Throwable t)
- {
- throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
- }
- }
-
- return factory;
- }
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
-
- PropertyAccessAction(String name)
- {
- this.name = name;
- }
-
- public Object run()
- {
- return System.getProperty(name);
- }
- }
-
- private static class PropertyFileAccessAction implements PrivilegedAction
- {
- private String filename;
-
- PropertyFileAccessAction(String filename)
- {
- this.filename = filename;
- }
-
- public Object run()
- {
- try
- {
- InputStream inStream = new FileInputStream(filename);
- Properties props = new Properties();
- props.load(inStream);
- return props;
- }
- catch (IOException ex)
- {
- throw new SecurityException("Cannot load properties: " + filename, ex);
- }
- }
- }
-}
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/SecurityAdaptorFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.ws.integration.FactoryLoader;
+import org.jboss.wsf.spi.utils.ServiceLoader;
/**
* A container idependent SecurityAdaptorFactory
@@ -35,7 +35,7 @@
{
public static SecurityAdaptor getSecurityAdaptor()
{
- SecurityAdaptor securityAdaptor = (SecurityAdaptor)FactoryLoader.loadFactory(SecurityAdaptor.class.getName(), null);
+ SecurityAdaptor securityAdaptor = (SecurityAdaptor)ServiceLoader.loadService(SecurityAdaptor.class.getName(), null);
if (securityAdaptor == null)
throw new IllegalStateException("Cannot load SecurityAdaptor");
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumer.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -1,35 +1,34 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.wsf.spi.tools;
-import org.jboss.ws.integration.FactoryLoader;
-import org.jboss.wsf.spi.tools.WSContractConsumerFactory;
-
import java.io.File;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
+import org.jboss.wsf.spi.utils.ServiceLoader;
+
/**
* WSContractConsumer is responsible for generating JAX-WS client and server
* artifacts from the specified WSDL file. To implement a client, one would use
@@ -56,7 +55,7 @@
{
return newInstance(Thread.currentThread().getContextClassLoader());
}
-
+
/**
* Obtain a new instance of a WSContractConsumer. The specified ClassLoader will be used to
* locate the WebServiceImporterProvide implementation
@@ -66,40 +65,40 @@
*/
public static WSContractConsumer newInstance(ClassLoader loader)
{
- ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(loader);
- WSContractConsumerFactory factory = (WSContractConsumerFactory)
- FactoryLoader.loadFactory(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
+ WSContractConsumerFactory factory = (WSContractConsumerFactory)ServiceLoader.loadService(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
return factory.createConsumer();
}
- finally{
+ finally
+ {
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
-
+
/**
* Specifies the JAX-WS and JAXB binding files to use on import operations.
*
* @param bindingFiles list of JAX-WS or JAXB binding files
*/
public abstract void setBindingFiles(List<File> bindingFiles);
-
+
/**
* Sets the OASIS XML Catalog file to use for entity resolution.
*
* @param catalog the OASIS XML Catalog file
*/
public abstract void setCatalog(File catalog);
-
+
/**
* Sets the main output directory. If the directory does not exist, it will be created.
*
* @param directory the root directory for generated files
*/
public abstract void setOutputDirectory(File directory);
-
+
/**
* Sets the source directory. This directory will contain any generated Java source.
* If the directory does not exist, it will be created. If not specified,
@@ -108,15 +107,14 @@
* @param directory the root directory for generated source code
*/
public abstract void setSourceDirectory(File directory);
-
+
/**
* Enables/Disables Java source generation.
*
* @param generateSource whether or not to generate Java source.
*/
public abstract void setGenerateSource(boolean generateSource);
-
-
+
/**
* Sets the target package for generated source. If not specified the default
* is based off of the XML namespace.
@@ -124,14 +122,14 @@
* @param targetPackage the target package for generated source
*/
public abstract void setTargetPackage(String targetPackage);
-
+
/**
* Sets the @@WebService.wsdlLocation and @@WebServiceClient.wsdlLocation attributes to a custom value.
*
* @param wsdlLocation the custom WSDL location to use in generated source
*/
public abstract void setWsdlLocation(String wsdlLocation);
-
+
/**
* Sets the PrintStream to use for status feedback. The simplest example
* would be to use System.out.
@@ -139,8 +137,7 @@
* @param messageStream the stream to use for status messages:
*/
public abstract void setMessageStream(PrintStream messageStream);
-
-
+
/**
* Sets the additional classpath to use if/when invoking the Java compiler.
* Typically an implementation will use the system <code>java.class.path</code>
@@ -153,7 +150,7 @@
* single jar or directory
*/
public abstract void setAdditionalCompilerClassPath(List<String> classPath);
-
+
/**
* Generate the required artifacts using the specified WSDL URL. This method
* may be called more than once, although this is probably not desireable
@@ -161,7 +158,7 @@
* @param wsdl the URL of the WSDL
*/
public abstract void consume(URL wsdl);
-
+
/**
* Generate the required artifacts using the specified WSDL. This method
* may be called more than once, although this is probably not desireable.
@@ -182,7 +179,7 @@
File file = new File(wsdl);
url = file.toURL();
}
-
+
consume(url);
}
}
Modified: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProvider.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProvider.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProvider.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -1,11 +1,9 @@
package org.jboss.wsf.spi.tools;
-import org.jboss.wsf.spi.tools.WSContractProviderFactory;
-import org.jboss.ws.integration.FactoryLoader;
-
import java.io.File;
import java.io.PrintStream;
+import org.jboss.wsf.spi.utils.ServiceLoader;
/**
* WSContractProvider is responsible for generating the required portable
@@ -33,12 +31,12 @@
{
private static String DEFAULT_PROVIDER = "org.jboss.ws.tools.jaxws.impl.JBossWSProviderFactoryImpl";
public static final String PROVIDER_PROPERTY = "org.jboss.wsf.tools.ProviderFactoryImpl";
-
- protected WSContractProvider()
+
+ protected WSContractProvider()
{
-
+
}
-
+
/**
* Obtain a new instance of a WSContractProvider. This will use the current
* thread's context class loader to locate the WSContractProviderFactory
@@ -50,7 +48,7 @@
{
return newInstance(Thread.currentThread().getContextClassLoader());
}
-
+
/**
* Obtain a new instance of a WSContractProvider. The specified ClassLoader will be used to
* locate the WSContractProviderFactory implementation
@@ -60,40 +58,40 @@
*/
public static WSContractProvider newInstance(ClassLoader loader)
{
- ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(loader);
- WSContractProviderFactory factory = (WSContractProviderFactory)
- FactoryLoader.loadFactory(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
+ WSContractProviderFactory factory = (WSContractProviderFactory)ServiceLoader.loadService(PROVIDER_PROPERTY, DEFAULT_PROVIDER);
return factory.createProvider(loader);
}
- finally{
+ finally
+ {
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
-
+
/**
* Enables/Disables WSDL generation.
*
* @param generateWsdl whether or not to generate WSDL
*/
public abstract void setGenerateWsdl(boolean generateWsdl);
-
+
/**
* Enables/Disables Java source generation.
*
* @param generateSource whether or not to generate Java source.
*/
public abstract void setGenerateSource(boolean generateSource);
-
+
/**
* Sets the main output directory. If the directory does not exist, it will be created.
*
* @param directory the root directory for generated files
*/
public abstract void setOutputDirectory(File directory);
-
+
/**
* Sets the resource directory. This directory will contain any generated
* WSDL and XSD files. If the directory does not exist, it will be created.
@@ -102,7 +100,7 @@
* @param directory the root directory for generated resource files
*/
public abstract void setResourceDirectory(File directory);
-
+
/**
* Sets the source directory. This directory will contain any generated Java source.
* If the directory does not exist, it will be created. If not specified,
@@ -111,7 +109,7 @@
* @param directory the root directory for generated source code
*/
public abstract void setSourceDirectory(File directory);
-
+
/**
* Sets the ClassLoader used to discover types. This defaults to the one used
* in instantiation.
@@ -119,7 +117,7 @@
* @param loader the ClassLoader to use
*/
public abstract void setClassLoader(ClassLoader loader);
-
+
/**
* Generates artifacts using the current settings. This method may be invoked
* more than once (e.g. multiple endpoints).
@@ -137,7 +135,7 @@
* @throws RuntimeException if any error occurs during processing
*/
public abstract void provide(Class<?> endpointClass);
-
+
/**
* Sets the PrintStream to use for status feedback. The simplest example
* would be to use System.out.
Added: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/utils/ServiceLoader.java
===================================================================
--- branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/utils/ServiceLoader.java (rev 0)
+++ branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/utils/ServiceLoader.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -0,0 +1,251 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+// $Id$
+
+/**
+ * Load a service class using this ordered lookup procedure
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 14-Dec-2006
+ */
+public abstract class ServiceLoader
+{
+ /**
+ * This method uses the algirithm below using the JAXWS Provider as an example.
+ *
+ * 1. If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then
+ * its first line, if present, is used as the UTF-8 encoded name of the implementation class.
+ *
+ * 2. If the ${java.home}/lib/jaxws.properties file exists and it is readable by the
+ * java.util.Properties.load(InputStream) method and it contains an entry whose key is
+ * javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
+ *
+ * 3. If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used
+ * as the name of the implementation class.
+ *
+ * 4. Finally, a default implementation class name is used.
+ */
+ public static Object loadService(String propertyName, String defaultFactory)
+ {
+ Object factory = loadFromServices(propertyName, null);
+ if (factory == null)
+ {
+ factory = loadFromPropertiesFile(propertyName, null);
+ }
+ if (factory == null)
+ {
+ factory = loadFromSystemProperty(propertyName, defaultFactory);
+ }
+ return factory;
+ }
+
+ /** Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ */
+ public static Object loadFromServices(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ String factoryName = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ /** Use the system property
+ */
+ public static Object loadFromSystemProperty(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ /**
+ * Use the properties file "${java.home}/lib/jaxws.properties" in the JRE directory.
+ * This configuration file is in standard java.util.Properties format and contains the
+ * fully qualified name of the implementation class with the key being the system property defined above.
+ */
+ public static Object loadFromPropertiesFile(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ String factoryName = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the properties file "lib/jaxm.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ PrivilegedAction action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxws.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ factory = loadDefault(defaultFactory);
+ }
+
+ return factory;
+ }
+
+ private static Object loadDefault(String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the default factory implementation class.
+ if (defaultFactory != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(defaultFactory);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load: " + defaultFactory, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
Property changes on: branches/jbossws-2.0/integration/spi/src/main/java/org/jboss/wsf/spi/utils/ServiceLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-2.0/jbossws-core/.classpath
===================================================================
--- branches/jbossws-2.0/jbossws-core/.classpath 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/.classpath 2007-06-08 15:50:12 UTC (rev 3509)
@@ -15,7 +15,7 @@
<classpathentry kind="lib" path="thirdparty/jboss-j2ee.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-logging-spi.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-microcontainer.jar"/>
- <classpathentry kind="lib" path="thirdparty/jboss-remoting.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jboss-remoting.jar" sourcepath="thirdparty/jboss-remoting-src.jar"/>
<classpathentry kind="lib" path="thirdparty/jbosssx-client.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-xml-binding.jar"/>
<classpathentry kind="lib" path="thirdparty/mail.jar"/>
Modified: branches/jbossws-2.0/jbossws-core/ant-import/build-thirdparty.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/ant-import/build-thirdparty.xml 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/ant-import/build-thirdparty.xml 2007-06-08 15:50:12 UTC (rev 3509)
@@ -77,6 +77,7 @@
<get src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-deployers-src.zip" dest="${thirdparty.dir}/jboss-deployers-src.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/microcontainer/${jboss-microcontainer}/lib/jboss-microcontainer-src.zip" dest="${thirdparty.dir}/jboss-microcontainer-src.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/remoting/${jboss-remoting}/lib/jboss-remoting.jar" dest="${thirdparty.dir}/jboss-remoting.jar" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/jboss/remoting/${jboss-remoting}/lib/jboss-remoting-src.jar" dest="${thirdparty.dir}/jboss-remoting-src.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/security/${jboss-security}/lib/jbosssx-client.jar" dest="${thirdparty.dir}/jbosssx-client.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/security/${jboss-security}/lib/jbosssx.jar" dest="${thirdparty.dir}/jbosssx.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/security/${jboss-security}/lib/jbosssx-src.zip" dest="${thirdparty.dir}/jbosssx-src.zip" usetimestamp="true" verbose="true"/>
Modified: branches/jbossws-2.0/jbossws-core/src/main/etc/component-info.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/etc/component-info.xml 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/etc/component-info.xml 2007-06-08 15:50:12 UTC (rev 3509)
@@ -31,6 +31,9 @@
<import componentref="jboss/jbossws-spi">
<compatible version="@repository.id@"/>
</import>
+ <import componentref="jboss/remoting">
+ <compatible version="@jboss-remoting@"/>
+ </import>
<import componentref="stax-api">
<compatible version="@stax-api@"/>
</import>
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/ServiceFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/ServiceFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/ServiceFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -25,11 +25,10 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Properties;
+import java.util.logging.Logger;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-
/** The javax.xml.rpc.ServiceFactory is an abstract class that provides a
* factory for the creation of instances of the type javax.xml.rpc.Service.
* This abstract class follows the abstract static factory design pattern.
@@ -46,7 +45,7 @@
public abstract class ServiceFactory
{
// provide logging
- private static Logger log = Logger.getLogger(ServiceFactory.class);
+ private static Logger log = Logger.getLogger(ServiceFactory.class.getName());
// The singlton
private static ServiceFactory factory;
@@ -101,7 +100,7 @@
}
catch (ClassNotFoundException e1)
{
- if(log.isDebugEnabled()) log.debug("Cannot load factory: " + factoryName);
+ log.severe("Cannot load factory: " + factoryName);
}
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -23,12 +23,12 @@
// $Id$
+import java.util.logging.Logger;
+
import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
-import org.jboss.logging.Logger;
-
/** The SOAPFaultException exception represents a SOAP fault.
*
* The message part in the SOAP fault maps to the contents of faultdetail
@@ -49,7 +49,7 @@
public class SOAPFaultException extends RuntimeException
{
// provide logging
- private static Logger log = Logger.getLogger(SOAPFaultException.class);
+ private static Logger log = Logger.getLogger(SOAPFaultException.class.getName());
private QName faultCode;
private String faultString;
@@ -61,7 +61,7 @@
super(faultString);
Name detailName = faultDetail != null ? faultDetail.getElementName() : null;
- if(log.isDebugEnabled()) log.debug("new SOAPFaultException [code=" + faultCode + ",string=" + faultString + ",actor=" + faultActor + ",detail=" + detailName + "]");
+ log.fine("new SOAPFaultException [code=" + faultCode + ",string=" + faultString + ",actor=" + faultActor + ",detail=" + detailName + "]");
this.faultCode = faultCode;
this.faultString = faultString;
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/MessageFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -24,8 +24,6 @@
import java.io.IOException;
import java.io.InputStream;
-import org.jboss.ws.integration.FactoryLoader;
-
/**
A factory for creating SOAPMessage objects.
@@ -72,7 +70,7 @@
try
{
String propertyName = "javax.xml.soap.MessageFactory";
- factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
+ factory = (MessageFactory)SAAJFactoryLoader.loadFactory(propertyName, null);
}
catch (RuntimeException rte)
{
Added: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJFactoryLoader.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJFactoryLoader.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJFactoryLoader.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.soap;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+
+// $Id$
+
+/**
+ * Load a factory using this ordered lookup procedure
+ *
+ * <ol>
+ * <li>Use the system property
+ * <li>Use the properties file "lib/jaxm.properties" in the JRE directory
+ * <li>Use the Services API (as detailed in the JAR specification), if available, to determine the classname
+ * <li>Use the default factory implementation class
+ * </ol>
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 14-Dec-2006
+ */
+public class SAAJFactoryLoader
+{
+ private SAAJFactoryLoader()
+ {
+ }
+
+ /**
+ *
+ * @return the factory impl, or null
+ */
+ public static Object loadFactory(String propertyName, String defaultFactory)
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the system property
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the properties file "lib/jaxm.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ if (factory == null)
+ {
+ action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ if (factory == null)
+ {
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ //if(log.isTraceEnabled()) log.trace("Load from Service API " + filename + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ try
+ {
+ factoryName = defaultFactory;
+ //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJFactoryLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -21,9 +21,6 @@
*/
package javax.xml.soap;
-import org.jboss.ws.integration.FactoryLoader;
-
-
// $Id$
/**
@@ -60,7 +57,7 @@
{
String propertyName = "javax.xml.soap.MetaFactory";
String defaultImpl = "org.jboss.ws.core.soap.SAAJMetaFactoryImpl";
- SAAJMetaFactory factory = (SAAJMetaFactory)FactoryLoader.loadFactory(propertyName, defaultImpl);
+ SAAJMetaFactory factory = (SAAJMetaFactory)SAAJFactoryLoader.loadFactory(propertyName, defaultImpl);
if (factory == null)
throw new SOAPException("Failed to to determine the implementation class for: " + propertyName);
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPConnectionFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPConnectionFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPConnectionFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -23,9 +23,8 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.logging.Logger;
-import org.jboss.logging.Logger;
-
/** A factory for creating SOAPConnection objects. Implementation of this class
* is optional. If SOAPConnectionFactory.newInstance() throws an
* UnsupportedOperationException then the implementation does not support the
@@ -40,7 +39,7 @@
public abstract class SOAPConnectionFactory
{
// provide logging
- private static Logger log = Logger.getLogger(SOAPConnectionFactory.class);
+ private static Logger log = Logger.getLogger(SOAPConnectionFactory.class.getName());
private static final String DEFAULT_SOAP_CONNECTION_FACTORY = "org.jboss.ws.core.soap.SOAPConnectionFactoryImpl";
private static final String[] alternativeFactories = new String[] { "org.jboss.webservice.soap.SOAPConnectionFactoryImpl",
@@ -81,7 +80,7 @@
}
catch (ClassNotFoundException e1)
{
- if(log.isDebugEnabled()) log.debug("Cannot load factory: " + factoryName);
+ log.severe("Cannot load factory: " + factoryName);
}
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/soap/SOAPFactory.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -25,7 +25,6 @@
import javax.xml.namespace.QName;
-import org.jboss.ws.integration.FactoryLoader;
import org.w3c.dom.Element;
/** SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
@@ -62,7 +61,7 @@
try
{
String propertyName = "javax.xml.soap.SOAPFactory";
- soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+ soapFactory = (SOAPFactory)SAAJFactoryLoader.loadFactory(propertyName, null);
}
catch (RuntimeException rte)
{
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/addressing/AddressingBuilder.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/addressing/AddressingBuilder.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/addressing/AddressingBuilder.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -28,15 +28,14 @@
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.logging.Logger;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-
public abstract class AddressingBuilder implements AddressingType
{
// provide logging
- private static Logger log = Logger.getLogger(AddressingBuilder.class);
+ private static Logger log = Logger.getLogger(AddressingBuilder.class.getName());
protected AddressingBuilder()
{
@@ -67,7 +66,7 @@
}
catch (Exception e)
{
- log.warn("Could not create and instance of " + name + " trying " + DEFAULT_ADDRESSING_BUILDER);
+ log.warning("Could not create and instance of " + name + " trying " + DEFAULT_ADDRESSING_BUILDER);
}
// default builder
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/Provider.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -33,7 +33,6 @@
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import org.jboss.ws.integration.FactoryLoader;
import org.w3c.dom.Element;
/**
@@ -88,7 +87,7 @@
{
try
{
- return (Provider)FactoryLoader.loadFactory(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER);
+ return (Provider)ProviderLoader.loadProvider(DEFAULT_JAXWSPROVIDER);
}
catch (WebServiceException ex)
{
Added: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/ProviderLoader.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/ProviderLoader.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/ProviderLoader.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.spi;
+
+// $Id$
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+/**
+ * Load the provider using the following algorithm.
+ *
+ * 1. If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then
+ * its first line, if present, is used as the UTF-8 encoded name of the implementation class.
+ *
+ * 2. If the ${java.home}/lib/jaxws.properties file exists and it is readable by the
+ * java.util.Properties.load(InputStream) method and it contains an entry whose key is
+ * javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
+ *
+ * 3. If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used
+ * as the name of the implementation class.
+ *
+ * 4. Finally, a default implementation class name is used.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 03-May-2006
+ */
+public abstract class ProviderLoader
+{
+ /**
+ * This method uses the algirithm described above.
+ *
+ * 1. If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then
+ * its first line, if present, is used as the UTF-8 encoded name of the implementation class.
+ *
+ * 2. If the ${java.home}/lib/jaxws.properties file exists and it is readable by the
+ * java.util.Properties.load(InputStream) method and it contains an entry whose key is
+ * javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class.
+ *
+ * 3. If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used
+ * as the name of the implementation class.
+ *
+ * 4. Finally, a default implementation class name is used.
+ */
+ public static Provider loadProvider(String defaultFactory)
+ {
+ Object factory = null;
+ String factoryName = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ String propertyName = Provider.JAXWSPROVIDER_PROPERTY;
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // Use the properties file "lib/jaxws.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ if (factory == null)
+ {
+ PrivilegedAction action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxws.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use system property
+ if (factory == null)
+ {
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ try
+ {
+ //if(log.isDebugEnabled()) log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(defaultFactory);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException("Failed to load: " + defaultFactory, t);
+ }
+ }
+
+ return (Provider)factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-core/src/main/java/javax/xml/ws/spi/ProviderLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -23,29 +23,34 @@
// $Id$
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.rpc.Stub;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.EndpointReference;
+
import org.jboss.logging.Logger;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.Marshaller;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.core.*;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.WSTimeoutException;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.config.EndpointProperty;
-import javax.xml.rpc.Stub;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.addressing.EndpointReference;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.SocketTimeoutException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
/**
* SOAPConnection implementation.
* <p/>
@@ -100,10 +105,6 @@
// HTTPClientInvoker conect sends gratuitous POST
// http://jira.jboss.com/jira/browse/JBWS-711
clientConfig.put(Client.ENABLE_LEASE, false);
-
- // Enable chunked encoding
- // This is the default size. May be overridden through endpoint config
- clientConfig.put("chunkedLength", "1024");
}
public boolean isClosed()
@@ -156,9 +157,6 @@
targetAddress = endpoint.toString();
}
- // remoting props may come from client config as well
- mergeConfigContribution();
-
// setup remoting client
Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
Client client = createRemotingClient(endpoint, targetAddress, oneway);
@@ -167,7 +165,7 @@
{
if (log.isDebugEnabled())
log.debug("Remoting metadata: " + metadata);
-
+
// debug the outgoing message
MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
@@ -195,9 +193,9 @@
}
catch (Throwable th)
{
- if(timeout!=null && (th.getCause() instanceof SocketTimeoutException))
+ if (timeout != null && (th.getCause() instanceof SocketTimeoutException))
{
- throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
+ throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
}
IOException io = new IOException("Could not transmit message");
@@ -206,25 +204,6 @@
}
}
- private void mergeConfigContribution()
- {
- // check for config property contribution
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if(msgContext!=null)
- {
- Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
-
- // chunksize settings
- String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
- int chunkSize = chunkSizeValue!=null ? Integer.valueOf(chunkSizeValue) : -1;
- if(chunkSize>0)
- clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
- else
- clientConfig.remove("chunkedLength");
-
- }
- }
-
private String addURLParameter(String url, String key, String value)
{
int qmIndex = url.indexOf("?");
@@ -278,6 +257,7 @@
private Map<String, Object> createRemotingMetaData(MessageAbstraction reqMessage, Map callProps)
{
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
Map<String, Object> metadata = new HashMap<String, Object>();
@@ -288,6 +268,27 @@
if (reqMessage != null)
{
populateHeaders(reqMessage, metadata);
+
+ // Enable chunked encoding. This is the default size.
+ clientConfig.put("chunkedLength", "1024");
+
+ // May be overridden through endpoint config
+ if (msgContext != null)
+ {
+ Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
+
+ // chunksize settings
+ String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) : -1;
+ if (chunkSize > 0)
+ {
+ clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
+ }
+ else
+ {
+ clientConfig.remove("chunkedLength");
+ }
+ }
}
else
{
@@ -345,7 +346,7 @@
protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
{
MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
-
+
Properties props = new Properties();
metadata.put("HEADER", props);
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -45,8 +45,8 @@
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.XMLFragment;
-import org.jboss.ws.integration.FactoryLoader;
import org.jboss.wsf.spi.utils.DOMUtils;
+import org.jboss.wsf.spi.utils.ServiceLoader;
import org.w3c.dom.Element;
/**
@@ -111,7 +111,7 @@
try
{
soapBody.removeContents();
- EnvelopeBuilder envBuilder = (EnvelopeBuilder)FactoryLoader.loadFactory(EnvelopeBuilder.class.getName(), null);
+ EnvelopeBuilder envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
envBuilder.setStyle(style);
Element domBodyElement = DOMUtils.sourceToElement(source);
envBuilder.buildBodyElementRpc(soapBody, domBodyElement);
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/HttpServer.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -28,7 +28,7 @@
import javax.xml.ws.Endpoint;
-import org.jboss.ws.integration.FactoryLoader;
+import org.jboss.wsf.spi.utils.ServiceLoader;
/**
* An abstract HTTP Server
@@ -53,7 +53,7 @@
*/
public static HttpServer create()
{
- HttpServer server = (HttpServer)FactoryLoader.loadFactory(HTTP_SERVER_PROPERTY, null);
+ HttpServer server = (HttpServer)ServiceLoader.loadService(HTTP_SERVER_PROPERTY, null);
return server;
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -45,7 +45,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
-import org.jboss.ws.integration.FactoryLoader;
+import org.jboss.wsf.spi.utils.ServiceLoader;
import org.jboss.wsf.spi.utils.IOUtils;
/**
@@ -249,7 +249,7 @@
soapMessage.setAttachments(attachments);
// Get the SOAPEnvelope builder
- EnvelopeBuilder envBuilder = (EnvelopeBuilder)FactoryLoader.loadFactory(EnvelopeBuilder.class.getName(), null);
+ EnvelopeBuilder envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
envBuilder.setStyle(getStyle());
// Build the payload
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -143,7 +143,7 @@
}
public SOAPElement setElementQNameInternal(QName qname) throws SOAPException
- {
+ {
elementName = new NameImpl(qname);
Document owner = domNode.getOwnerDocument();
@@ -153,7 +153,6 @@
return this.completeNamespaceDeclaration();
}
-
/**
* Adds an attribute with the specified name and value to this SOAPElement object.
*
@@ -325,8 +324,17 @@
public SOAPElement addTextNode(String value) throws SOAPException
{
log.trace("addTextNode: " + value);
- org.w3c.dom.Text domText = element.getOwnerDocument().createTextNode(value);
- javax.xml.soap.Text soapText = new TextImpl(domText);
+ org.w3c.dom.Node domNode;
+ if (value.startsWith("<!--") && value.endsWith("-->"))
+ {
+ value = value.substring(4, value.length() - 3);
+ domNode = element.getOwnerDocument().createComment(value);
+ }
+ else
+ {
+ domNode = element.getOwnerDocument().createTextNode(value);
+ }
+ javax.xml.soap.Text soapText = new TextImpl(domNode);
appendChild(soapText);
return this;
}
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.OutputStream;
-import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -42,7 +42,7 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.integration.FactoryLoader;
+import org.jboss.wsf.spi.utils.ServiceLoader;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
@@ -172,7 +172,7 @@
else
throw new SOAPException("Unsupported DOMSource node: " + node);
- EnvelopeBuilder envBuilder = (EnvelopeBuilder)FactoryLoader.loadFactory(EnvelopeBuilder.class.getName(), null);
+ EnvelopeBuilder envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
envBuilder.setStyle(Style.DOCUMENT);
envBuilder.build(soapMessage, domElement);
}
@@ -181,7 +181,7 @@
try
{
StreamSource streamSource = (StreamSource)source;
- EnvelopeBuilder envBuilder = (EnvelopeBuilder)FactoryLoader.loadFactory(EnvelopeBuilder.class.getName(), null);
+ EnvelopeBuilder envBuilder = (EnvelopeBuilder)ServiceLoader.loadService(EnvelopeBuilder.class.getName(), null);
envBuilder.setStyle(Style.DOCUMENT);
InputStream stream = streamSource.getInputStream();
Reader reader = streamSource.getReader();
Modified: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-06-08 15:50:12 UTC (rev 3509)
@@ -89,12 +89,12 @@
/**
* [JBWS-1706] SOAPConnection.get fails with ProtocolException
*
- * Gets a SOAP response message from a specific endpoint
- * and blocks until it has received the response. HTTP-GET
- * from a valid endpoint that contains a valid webservice
- * resource should succeed. The endpoint tested contains
- * a valid webservice resource that must return a SOAP
- * response. HTTP-GET must succeed.
+ * Gets a SOAP response message from a specific endpoint
+ * and blocks until it has received the response. HTTP-GET
+ * from a valid endpoint that contains a valid webservice
+ * resource should succeed. The endpoint tested contains
+ * a valid webservice resource that must return a SOAP
+ * response. HTTP-GET must succeed.
*
*/
public void testSOAPConnectionGet() throws Exception
@@ -106,6 +106,7 @@
SOAPEnvelope env = resMessage.getSOAPPart().getEnvelope();
String envStr = DOMWriter.printNode(env, false);
- System.out.println(envStr);
+ String expStr = "<ztrade:GetLastTradePriceResponse xmlns:ztrade='http://wombat.ztrade.com'><Price>95.12</Price></ztrade:GetLastTradePriceResponse>";
+ assertTrue(envStr.contains(expStr));
}
}
Modified: branches/jbossws-2.0/jbossws-core/version.properties
===================================================================
--- branches/jbossws-2.0/jbossws-core/version.properties 2007-06-08 15:44:29 UTC (rev 3508)
+++ branches/jbossws-2.0/jbossws-core/version.properties 2007-06-08 15:50:12 UTC (rev 3509)
@@ -20,7 +20,7 @@
hibernate=3.2.1.GA
jaxen=1.1-beta-10
jboss-ejb3=1.0.0.CR9-jboss4.0.5
-jboss-remoting=2.0.0.GA
+jboss-remoting=2.2.0.SP4
jboss-security=4.0.5.GA
jboss-vfs=2.0.0.Beta2
jbossas-core-libs=4.2.0.GA
More information about the jbossws-commits
mailing list