Author: thomas.diesler(a)jboss.com
Date: 2007-08-02 02:29:52 -0400 (Thu, 02 Aug 2007)
New Revision: 4075
Added:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefMetaDataParser.java
Removed:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelLocator.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/ServiceLoader.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/
Modified:
branches/tdiesler/trunk/integration/jboss40/.classpath
branches/tdiesler/trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapterFactory.java
branches/tdiesler/trunk/integration/jboss42/.classpath
branches/tdiesler/trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java
branches/tdiesler/trunk/integration/jboss50/.classpath
branches/tdiesler/trunk/integration/native/.classpath
branches/tdiesler/trunk/integration/spi/.classpath
branches/tdiesler/trunk/integration/spi/build.xml
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
branches/tdiesler/trunk/integration/sunri/.classpath
branches/tdiesler/trunk/integration/xfire/.classpath
branches/tdiesler/trunk/jbossws-core/.classpath
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
branches/tdiesler/trunk/testsuite/.classpath
Log:
partial
Modified: branches/tdiesler/trunk/integration/jboss40/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss40/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/jboss40/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -11,5 +11,6 @@
<classpathentry kind="con"
path="org.eclipse.jdt.USER_LIBRARY/jboss-4.0.x"/>
<classpathentry combineaccessrules="false" kind="src"
path="/integration-jboss42"/>
<classpathentry combineaccessrules="false" kind="src"
path="/jbossws-core"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified:
branches/tdiesler/trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapterFactory.java
===================================================================
---
branches/tdiesler/trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapterFactory.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/jboss40/src/main/java/org/jboss/wsf/container/jboss40/ServiceRefMetaDataAdapterFactory.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -25,7 +25,7 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.wsf.common.KernelLocator;
+import org.jboss.wsf.spi.util.KernelLocator;
/**
* @author Thomas.Diesler(a)jboss.org
Modified: branches/tdiesler/trunk/integration/jboss42/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss42/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/jboss42/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -9,5 +9,6 @@
<classpathentry kind="lib"
path="/integration-spi/thirdparty/jsr181-api.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/saaj-api.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/dom4j.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified:
branches/tdiesler/trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java
===================================================================
---
branches/tdiesler/trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/jboss42/src/main/java/org/jboss/ws/integration/KernelLocator.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -32,6 +32,6 @@
{
public static Kernel getKernel()
{
- return org.jboss.wsf.common.KernelLocator.getKernel();
+ return org.jboss.wsf.spi.util.KernelLocator.getKernel();
}
}
Modified: branches/tdiesler/trunk/integration/jboss50/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/jboss50/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/jboss50/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -9,5 +9,6 @@
<classpathentry kind="lib"
path="/integration-spi/thirdparty/jsr181-api.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/saaj-api.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/dom4j.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/native/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/native/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/native/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -9,5 +9,6 @@
<classpathentry kind="lib"
path="/integration-spi/thirdparty/jboss-common-core.jar"/>
<classpathentry kind="lib"
path="/jbossws-core/thirdparty/wsdl4j.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/activation.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/spi/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/spi/.classpath 2007-08-02 06:26:38 UTC (rev 4074)
+++ branches/tdiesler/trunk/integration/spi/.classpath 2007-08-02 06:29:52 UTC (rev 4075)
@@ -23,5 +23,6 @@
<classpathentry kind="lib" path="thirdparty/getopt.jar"/>
<classpathentry kind="lib" path="thirdparty/saaj-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/spi/build.xml
===================================================================
--- branches/tdiesler/trunk/integration/spi/build.xml 2007-08-02 06:26:38 UTC (rev 4074)
+++ branches/tdiesler/trunk/integration/spi/build.xml 2007-08-02 06:29:52 UTC (rev 4075)
@@ -71,9 +71,6 @@
<mkdir dir="${spi.output.etc.dir}"/>
<copy todir="${spi.output.etc.dir}" filtering="yes">
<fileset dir="${spi.etc.dir}"/>
- <fileset dir="${spi.etc.dir}">
- <include name="default.mf"/>
- </fileset>
<filterset>
<filter token="java.vm.version"
value="${java.vm.version}"/>
<filter token="java.vm.vendor"
value="${java.vm.vendor}"/>
@@ -99,11 +96,13 @@
-->
<target name="module-jars">
- <!-- Build jbossws-spi.jar -->
+ <!-- Build jbossws-framework.jar -->
<mkdir dir="${spi.output.lib.dir}"/>
- <jar jarfile="${spi.output.lib.dir}/jbossws-spi.jar"
manifest="${spi.output.etc.dir}/default.mf">
+ <jar jarfile="${spi.output.lib.dir}/jbossws-framework.jar"
manifest="${spi.output.etc.dir}/default.mf">
<fileset dir="${spi.output.classes.dir}">
- <include name="org/jboss/wsf/**"/>
+ <include name="org/jboss/wsf/common/**"/>
+ <include name="org/jboss/wsf/framework/**"/>
+ <include name="org/jboss/wsf/test/**"/>
</fileset>
</jar>
@@ -137,7 +136,6 @@
<javadoc destdir="${spi.output.apidocs.dir}" author="true"
version="true" use="true" windowtitle="JBossWS API">
<classpath refid="spi.thirdparty.classpath"/>
<packageset dir="${spi.java.dir}"
defaultexcludes="yes">
- <include name="org/jboss/ws/**"/>
<include name="org/jboss/wsf/**"/>
</packageset>
<doctitle><![CDATA[<h1>JBoss Web Service Framework -
SPI</h1>]]></doctitle>
Modified:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelAwareSPIFactory.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -24,7 +24,7 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.wsf.common.KernelLocator;
+import org.jboss.wsf.spi.util.KernelLocator;
/**
* @author Heiko.Braun(a)jboss.com
Deleted:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelLocator.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelLocator.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/KernelLocator.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -1,47 +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.wsf.common;
-
-//$Id: KernelLocator.java 3137 2007-05-18 13:41:57Z thomas.diesler(a)jboss.com $
-
-import org.jboss.kernel.Kernel;
-
-/**
- * Locate the single instance of the kernel
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class KernelLocator
-{
- private static Kernel kernel;
-
- public static Kernel getKernel()
- {
- return KernelLocator.kernel;
- }
-
- public void setKernel(Kernel kernel)
- {
- KernelLocator.kernel = kernel;
- }
-}
Deleted:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/ServiceLoader.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/ServiceLoader.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/common/ServiceLoader.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -1,251 +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.wsf.common;
-
-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(a)jboss.com
- * @since 14-Dec-2006
- */
-public abstract class ServiceLoader
-{
- /**
- * This method uses the algorithm 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);
- }
- }
- }
-}
Modified:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -22,7 +22,6 @@
package org.jboss.wsf.framework;
import org.jboss.logging.Logger;
-import org.jboss.wsf.common.ServiceLoader;
import org.jboss.wsf.framework.deployment.DefaultDeploymentAspectManagerFactory;
import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
@@ -31,6 +30,7 @@
import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandler;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
+import org.jboss.wsf.framework.serviceref.DefaultServiceRefMetaDataParserFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.WSFException;
@@ -46,8 +46,10 @@
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.ServiceRefMetaDataParserFactory;
import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.util.ServiceLoader;
/**
* @author Heiko.Braun(a)jboss.com
@@ -106,6 +108,10 @@
{
returnType = (T)loadService(spiType,
DefaultServiceRefHandlerFactory.class.getName());
}
+ else if (ServiceRefMetaDataParserFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType,
DefaultServiceRefMetaDataParserFactory.class.getName());
+ }
// SPI provided by either container or stack integration
Added:
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefMetaDataParser.java
===================================================================
---
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefMetaDataParser.java
(rev 0)
+++
branches/tdiesler/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefMetaDataParser.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -0,0 +1,256 @@
+/*
+ * 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.framework.serviceref;
+
+// $Id: ServiceRefMetaDataParser.java 3959 2007-07-20 14:44:19Z heiko.braun(a)jboss.com $
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.ServiceRefMetaDataParser;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+import org.jboss.xb.QNameBuilder;
+import org.w3c.dom.Element;
+
+/**
+ * The metdata data from service-ref element in web.xml, ejb-jar.xml, and
+ * application-client.xml.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class DefaultServiceRefMetaDataParser implements ServiceRefMetaDataParser
+{
+ private static final Logger log =
Logger.getLogger(DefaultServiceRefMetaDataParser.class);
+
+ public void importStandardXml(Element root, UnifiedServiceRefMetaData sref)
+ {
+ sref.setServiceRefName(getElementContent(root, "service-ref-name"));
+ sref.setServiceInterface(getOptionalElementContent(root,
"service-interface"));
+ sref.setWsdlFile(getOptionalElementContent(root, "wsdl-file"));
+ sref.setMappingFile(getOptionalElementContent(root,
"jaxrpc-mapping-file"));
+
+ Element child = DOMUtils.getFirstChildElement(root, "service-qname");
+ if (child != null)
+ sref.setServiceQName(QNameBuilder.buildQName(child, getTextContent(child)));
+
+ // Parse the port-component-ref elements
+ Iterator iterator = DOMUtils.getChildElements(root,
"port-component-ref");
+ while (iterator.hasNext())
+ {
+ Element pcrefElement = (Element)iterator.next();
+ UnifiedPortComponentRefMetaData pcrefMetaData = new
UnifiedPortComponentRefMetaData(sref);
+ pcrefMetaData.importStandardXml(pcrefElement);
+ sref.addPortComponentRef(pcrefMetaData);
+ }
+
+ // Parse the handler elements
+ iterator = DOMUtils.getChildElements(root, "handler");
+ while (iterator.hasNext())
+ {
+ Element handlerElement = (Element)iterator.next();
+ UnifiedHandlerMetaData handlerMetaData = new UnifiedHandlerMetaData();
+ handlerMetaData.importStandardXml(handlerElement);
+ sref.addHandler(handlerMetaData);
+ }
+ }
+
+ public void importJBossXml(Element root, UnifiedServiceRefMetaData sref)
+ {
+ sref.setConfigName(getOptionalElementContent(root, "config-name"));
+ sref.setConfigFile(getOptionalElementContent(root, "config-file"));
+ sref.setWsdlOverride(getOptionalElementContent(root, "wsdl-override"));
+
+ // Parse the port-component-ref elements
+ Iterator iterator = DOMUtils.getChildElements(root,
"port-component-ref");
+ while (iterator.hasNext())
+ {
+ Element pcrefElement = (Element)iterator.next();
+ String seiName = getOptionalElementContent(pcrefElement,
"service-endpoint-interface");
+ QName portName = getOptionalElementContentAsQName(pcrefElement,
"port-qname");
+
+ UnifiedPortComponentRefMetaData pcref = sref.getPortComponentRef(seiName,
portName);
+ if (pcref == null && seiName != null)
+ {
+ // Its ok to only have the <port-component-ref> in jboss.xml and not in
ejb-jar.xml
+ // if it has at least a SEI declared
+ pcref = new UnifiedPortComponentRefMetaData(sref);
+ pcref.importStandardXml(pcrefElement);
+ sref.addPortComponentRef(pcref);
+ }
+
+ if (pcref != null)
+ pcref.importJBossXml(pcrefElement);
+ }
+
+ // Parse the call-property elements
+ iterator = DOMUtils.getChildElements(root, "call-property");
+ while (iterator.hasNext())
+ {
+ Element propElement = (Element)iterator.next();
+ String name = getElementContent(propElement, "prop-name");
+ String value = getElementContent(propElement, "prop-value");
+ sref.addCallProperty(new UnifiedCallPropertyMetaData(name, value));
+ }
+ }
+
+ public void importStandardXml(Element root, UnifiedPortComponentRefMetaData pcref)
+ {
+ pcref.setServiceEndpointInterface(getOptionalElementContent(root,
"service-endpoint-interface"));
+ pcref.setPortComponentLink(getOptionalElementContent(root,
"port-component-link"));
+ }
+
+ public void importJBossXml(Element root, UnifiedPortComponentRefMetaData pcref)
+ {
+ // Look for call-property elements
+ Iterator iterator = DOMUtils.getChildElements(root, "call-property");
+ while (iterator.hasNext())
+ {
+ Element propElement = (Element)iterator.next();
+ String name = getElementContent(propElement, "prop-name");
+ String value = getElementContent(propElement, "prop-value");
+ pcref.addCallProperty(new UnifiedCallPropertyMetaData(name, value));
+ }
+
+ // Look for stub-property elements
+ iterator = DOMUtils.getChildElements(root, "stub-property");
+ while (iterator.hasNext())
+ {
+ Element propElement = (Element)iterator.next();
+ String name = getElementContent(propElement, "prop-name");
+ String value = getElementContent(propElement, "prop-value");
+ UnifiedStubPropertyMetaData propMetaData = new UnifiedStubPropertyMetaData();
+ propMetaData.setPropName(name);
+ propMetaData.setPropValue(value);
+ pcref.addStubProperty(propMetaData);
+ }
+
+ // portQName
+ QName portQName = getOptionalElementContentAsQName(root, "port-qname");
+ if (portQName != null)
+ pcref.setPortQName(portQName);
+
+ // config
+ Element configName = DOMUtils.getFirstChildElement(root, "config-name");
+ if (configName != null)
+ pcref.setConfigName(getTextContent(configName));
+
+ Element configFile = DOMUtils.getFirstChildElement(root, "config-file");
+ if (configFile != null)
+ pcref.setConfigFile(getTextContent(configFile));
+
+ // service-endpoint-interface
+ Element sei = DOMUtils.getFirstChildElement(root,
"service-endpoint-interface");
+ if (sei != null)
+ pcref.setServiceEndpointInterface(getTextContent(sei));
+
+ }
+
+ public void importStandardXml(Element root, UnifiedHandlerMetaData href)
+ {
+ href.setHandlerName(getElementContent(root, "handler-name"));
+ href.setHandlerClass(getElementContent(root, "handler-class"));
+
+ // Parse the init-param elements
+ Iterator iterator = DOMUtils.getChildElements(root, "init-param");
+ while (iterator.hasNext())
+ {
+ Element paramElement = (Element)iterator.next();
+ UnifiedInitParamMetaData param = new UnifiedInitParamMetaData();
+ param.setParamName(getElementContent(paramElement, "param-name"));
+ param.setParamValue(getElementContent(paramElement, "param-value"));
+ href.addInitParam(param);
+ }
+
+ // Parse the soap-header elements
+ iterator = DOMUtils.getChildElements(root, "soap-header");
+ while (iterator.hasNext())
+ {
+ Element headerElement = (Element)iterator.next();
+ String content = getTextContent(headerElement);
+ QName qname = DOMUtils.resolveQName(headerElement, content);
+ href.addSoapHeader(qname);
+ }
+
+ // Parse the soap-role elements
+ iterator = DOMUtils.getChildElements(root, "soap-role");
+ while (iterator.hasNext())
+ {
+ Element roleElement = (Element)iterator.next();
+ String content = getTextContent(roleElement);
+ href.addSoapRole(content);
+ }
+
+ // Parse the port-name elements
+ iterator = DOMUtils.getChildElements(root, "port-name");
+ while (iterator.hasNext())
+ {
+ Element portElement = (Element)iterator.next();
+ String content = getTextContent(portElement);
+ href.addPortName(content);
+ }
+ }
+
+ private String getElementContent(Element element, String childName)
+ {
+ String childValue = getOptionalElementContent(element, childName);
+ if (childValue == null || childValue.length() == 0)
+ throw new IllegalStateException("Invalid null element content: " +
childName);
+
+ return childValue;
+ }
+
+ private String getOptionalElementContent(Element element, String childName)
+ {
+ return getTextContent(DOMUtils.getFirstChildElement(element, childName));
+ }
+
+ private QName getOptionalElementContentAsQName(Element element, String childName)
+ {
+ QName qname = null;
+ String value = getOptionalElementContent(element, childName);
+ if (value != null)
+ {
+ qname = (value.startsWith("{") ? QName.valueOf(value) :
DOMUtils.resolveQName(element, value));
+ }
+ return qname;
+ }
+
+ private String getTextContent(Element element)
+ {
+ String content = null;
+ if (element != null)
+ {
+ content = DOMUtils.getTextContent(element);
+ if (content != null)
+ content = content.trim();
+ }
+ return content;
+ }
+}
Modified: branches/tdiesler/trunk/integration/sunri/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/sunri/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/sunri/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -24,5 +24,6 @@
<classpathentry kind="lib"
path="/integration-spi/thirdparty/dom4j.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/jboss-common-core.jar"/>
<classpathentry combineaccessrules="false" kind="src"
path="/integration-jboss50"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/integration/xfire/.classpath
===================================================================
--- branches/tdiesler/trunk/integration/xfire/.classpath 2007-08-02 06:26:38 UTC (rev
4074)
+++ branches/tdiesler/trunk/integration/xfire/.classpath 2007-08-02 06:29:52 UTC (rev
4075)
@@ -19,5 +19,6 @@
<classpathentry kind="lib"
path="thirdparty/spring-beans.jar"/>
<classpathentry kind="lib"
path="thirdparty/spring-core.jar"/>
<classpathentry kind="lib" path="thirdparty/spring-web.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/jbossws-core/.classpath
===================================================================
--- branches/tdiesler/trunk/jbossws-core/.classpath 2007-08-02 06:26:38 UTC (rev 4074)
+++ branches/tdiesler/trunk/jbossws-core/.classpath 2007-08-02 06:29:52 UTC (rev 4075)
@@ -37,5 +37,6 @@
<classpathentry kind="lib"
path="thirdparty/jaxws-tools.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxws-rt.jar"/>
<classpathentry kind="lib" path="thirdparty/concurrent.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java
===================================================================
---
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBContextFactory.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -22,7 +22,7 @@
package org.jboss.ws.core.jaxws;
import org.jboss.ws.WSException;
-import org.jboss.wsf.common.ServiceLoader;
+import org.jboss.wsf.spi.util.ServiceLoader;
import javax.xml.bind.JAXBContext;
@@ -41,7 +41,7 @@
public abstract JAXBContext createContext(Class clazz) throws WSException;
/**
- * Retrieve JAXBContextFactory instance through the {@link
org.jboss.wsf.common.ServiceLoader}.
+ * Retrieve JAXBContextFactory instance through the {@link
org.jboss.wsf.spi.util.ServiceLoader}.
* Defaults to {@link CustomizableJAXBContextFactory}
* @return JAXBContextFactory
*/
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
---
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -47,7 +47,7 @@
import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.ServiceLoader;
+import org.jboss.wsf.spi.util.ServiceLoader;
import org.w3c.dom.Element;
/**
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
---
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -45,8 +45,8 @@
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.wsf.common.ServiceLoader;
import org.jboss.wsf.common.IOUtils;
+import org.jboss.wsf.spi.util.ServiceLoader;
/**
* MessageFactory implementation
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
---
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -42,7 +42,7 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.wsf.common.ServiceLoader;
+import org.jboss.wsf.spi.util.ServiceLoader;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java
===================================================================
---
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2007-08-02
06:26:38 UTC (rev 4074)
+++
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/eventing/mgmt/SubscriptionManagerFactory.java 2007-08-02
06:29:52 UTC (rev 4075)
@@ -2,7 +2,7 @@
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.wsf.common.KernelLocator;
+import org.jboss.wsf.spi.util.KernelLocator;
/**
* @author Heiko Braun, <heiko(a)openj.net>
Modified: branches/tdiesler/trunk/testsuite/.classpath
===================================================================
--- branches/tdiesler/trunk/testsuite/.classpath 2007-08-02 06:26:38 UTC (rev 4074)
+++ branches/tdiesler/trunk/testsuite/.classpath 2007-08-02 06:29:52 UTC (rev 4075)
@@ -15,5 +15,6 @@
<classpathentry kind="lib"
path="/integration-spi/thirdparty/jaxb-impl.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/stax-api.jar"/>
<classpathentry kind="lib"
path="/integration-spi/thirdparty/wsdl4j.jar"
sourcepath="/integration-spi/thirdparty/wsdl4j-src.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/spi"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>