JBossWS SVN: r1773 - in branches/tdiesler/trunk/jbossws-tests: . ant-import src/main/etc src/main/java/org/jboss/test/ws src/main/java/org/jboss/test/ws/jaxws/eardeployment src/main/resources src/main/resources/jaxws/eardeployment/META-INF
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:26 -0500 (Sat, 23 Dec 2006)
New Revision: 1773
Added:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt
Removed:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt
Modified:
branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
branches/tdiesler/trunk/jbossws-tests/build.xml
branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
Log:
Fix jse deployement for jboss42
Modified: branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -18,6 +18,8 @@
<target name="build-jars" description="Build the jaxrpc deployments">
+ <mkdir dir="${tests.output.dir}/libs"/>
+
<!-- jaxrpc-anonymous -->
<war warfile="${tests.output.dir}/libs/jaxrpc-anonymous.war" webxml="${tests.output.dir}/resources/jaxrpc/anonymous/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -18,6 +18,8 @@
<target name="build-jars" description="Build the deployments.">
+ <mkdir dir="${tests.output.dir}/libs"/>
+
<!-- jaxws-asynchronous -->
<war warfile="${tests.output.dir}/libs/jaxws-asynchronous.war" webxml="${tests.output.dir}/resources/jaxws/asynchronous/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -68,6 +70,15 @@
<include name="jboss-app.xml"/>
</metainf>
</jar>
+ <jar jarfile="${tests.output.dir}/libs/jaxws-eardeployment42.ear">
+ <fileset dir="${tests.output.dir}/libs">
+ <include name="jaxws-eardeployment.jar"/>
+ <include name="jaxws-eardeployment.war"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxws/eardeployment/META-INF">
+ <include name="application.xml"/>
+ </metainf>
+ </jar>
<!-- jaxws-endpoint-servlet -->
<war warfile="${tests.output.dir}/libs/jaxws-endpoint-servlet.war" webxml="${tests.output.dir}/resources/jaxws/endpoint/WEB-INF/web.xml">
Modified: branches/tdiesler/trunk/jbossws-tests/build.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/build.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/build.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -110,7 +110,7 @@
<target name="init" depends="prepare,thirdparty">
<!-- Define excluded tests -->
- <condition property="tests.excludesfile" value="${tests.resources.dir}/tests-excludes.txt">
+ <condition property="tests.excludesfile" value="${tests.resources.dir}/tests-no-excludes.txt">
<equals arg1="${jbossws.target.server}" arg2="jboss"/>
</condition>
<condition property="tests.excludesfile" value="${tests.resources.dir}/tests-tomcat-excludes.txt">
@@ -159,8 +159,9 @@
-->
<path id="test.client.classpath">
<path refid="jbossws.client.classpath"/>
- <pathelement location="${core.output.lib.dir}/jbossws-${jboss.integration.target}-integration.jar"/>
- <pathelement location="${core.output.lib.dir}/jbossws-tomcat-integration.jar"/>
+ <pathelement location="${integration.jboss50.dir}/output/lib/jbossws-${jboss.integration.target}-integration.jar"/>
+ <pathelement location="${integration.jboss42.dir}/output/lib/jbossws-${jboss.integration.target}-integration.jar"/>
+ <pathelement location="${integration.tomcat.dir}/output/lib/jbossws-tomcat-integration.jar"/>
<pathelement location="${jboss.client}/jboss-aspect-jdk50-client.jar"/>
<pathelement location="${jboss.client}/jboss-aop-jdk50-client.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
@@ -180,7 +181,7 @@
<!-- Compiling -->
<!-- ================================================================== -->
- <target name="compile" depends="core-jars,jboss42-jars,jboss50-jars,tomcat-jars,compile14,compile15" description="Compile sources"/>
+ <target name="compile" depends="compile14,compile15" description="Compile sources"/>
<target name="compile14" depends="init" unless="HAVE_JDK_1.5">
<mkdir dir="${tests.output.dir}/classes"/>
@@ -242,8 +243,6 @@
<!-- ================================================================== -->
<target name="main" depends="compile,copy-resources,generate-sources,compile-generated,copy-generated" description="Build the deployments.">
- <mkdir dir="${tests.output.dir}/reports"/>
- <mkdir dir="${tests.output.dir}/libs"/>
<ant antfile="${basedir}/ant-import/build-jars-jaxrpc.xml" target="build-jars" inheritall="true"/>
<ant antfile="${basedir}/ant-import/build-jars-jaxws.xml" target="build-jars" inheritall="true"/>
</target>
@@ -317,7 +316,7 @@
<antcall target="tests-main">
<param name="include.wildcard" value="org/jboss/test/ws/**/*TestCase.class"/>
<param name="exclude.wildcard" value="org/jboss/test/ws/*/benchmark/**"/>
- <param name="excludesfile" value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile" value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -326,7 +325,7 @@
<target name="tests-benchmark" description="Run benchmark unit tests">
<antcall target="tests-main">
<param name="include.wildcard" value="org/jboss/test/ws/benchmark/**/*TestCase.class"/>
- <param name="excludesfile" value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile" value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -344,7 +343,7 @@
<target name="tests-tools" description="Run tools unit tests">
<antcall target="tests-main">
<param name="include.wildcard" value="org/jboss/test/ws/tools/**/*TestCase.class"/>
- <param name="excludesfile" value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile" value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -356,12 +355,14 @@
<target name="test" if="test" description="Run all unit tests in a given directory">
<antcall target="tests-main">
<param name="include.wildcard" value="org/jboss/test/ws/${test}/**/*TestCase.class"/>
- <param name="excludesfile" value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="exclude.wildcard" value="org/jboss/test/ws/*/benchmark/**"/>
+ <param name="excludesfile" value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
</target>
<!-- Common test target -->
<target name="tests-main" depends="init">
+ <mkdir dir="${tests.output.dir}/reports"/>
<junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}">
<jvmarg value="-Djava.security.manager"/>
<sysproperty key="java.security.policy" value="${tests.etc.dir}/tst.policy"/>
@@ -399,6 +400,7 @@
ant -Dtest=org.jboss.test.ws.jaxrpc.samples.jsr109pojo.RpcJSETestCase one-test
-->
<target name="one-test" depends="init" if="test" description="Run a single unit test">
+ <mkdir dir="${tests.output.dir}/reports"/>
<junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}">
<jvmarg line="${remote.debug.line}"/>
<jvmarg value="-Djava.security.manager"/>
Modified: branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -53,7 +53,7 @@
<!-- ================ -->
<category name="org.jboss.ws">
- <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ <priority value="DEBUG"/>
</category>
<category name="org.jboss.remoting">
Modified: branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java 2006-12-24 00:55:26 UTC (rev 1773)
@@ -70,6 +70,26 @@
return delegate.isTargetServerTomcat();
}
+ public String getJBossVersion()
+ {
+ return delegate.getJBossVersion();
+ }
+
+ public boolean isJBoss50()
+ {
+ return delegate.isJBoss50();
+ }
+
+ public boolean isJBoss42()
+ {
+ return delegate.isJBoss42();
+ }
+
+ public boolean isJBoss40()
+ {
+ return delegate.isJBoss40();
+ }
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
Modified: branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2006-12-24 00:55:26 UTC (rev 1773)
@@ -26,9 +26,12 @@
import java.net.URL;
import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
/**
* A JBossWS test helper that deals with test deployment/undeployment, etc.
*
@@ -37,6 +40,8 @@
*/
public class JBossWSTestHelper
{
+ private static MBeanServerConnection server;
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
@@ -54,23 +59,63 @@
}
/** True, if -Djbossws.target.server=jboss */
- public boolean isTargetServerJBoss()
+ public static boolean isTargetServerJBoss()
{
String targetServer = getTargetServer();
return "jboss".equals(targetServer);
}
/** True, if -Djbossws.target.server=tomcat */
- public boolean isTargetServerTomcat()
+ public static boolean isTargetServerTomcat()
{
String targetServer = getTargetServer();
return "tomcat".equals(targetServer);
}
- public MBeanServerConnection getServer() throws NamingException
+ public static String getJBossVersion()
{
- InitialContext iniCtx = new InitialContext();
- MBeanServerConnection server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ String jbossVersion = null;
+ if (isTargetServerJBoss())
+ {
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ ex.printStackTrace();
+ }
+ }
+ return jbossVersion;
+ }
+
+ public static boolean isJBoss50()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("5.0");
+ }
+
+ public static boolean isJBoss42()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("4.2");
+ }
+
+ public static boolean isJBoss40()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("4.0");
+ }
+
+ public static MBeanServerConnection getServer() throws NamingException
+ {
+ if (server == null)
+ {
+ InitialContext iniCtx = new InitialContext();
+ server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
return server;
}
@@ -92,7 +137,7 @@
}
}
- private String getTargetServer()
+ private static String getTargetServer()
{
return System.getProperty("jbossws.target.server");
}
Modified: branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-24 00:55:26 UTC (rev 1773)
@@ -29,6 +29,7 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestHelper;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
@@ -46,45 +47,49 @@
{
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(EarTestCase.class, "jaxws-eardeployment.ear");
+ String earName = (JBossWSTestHelper.isJBoss50() ? "jaxws-eardeployment.ear" : "jaxws-eardeployment42.ear");
+ return JBossWSTestSetup.newTestSetup(EarTestCase.class, earName);
}
-
+
public void testResourceURL() throws Exception
{
File earFile = new File("libs/jaxws-eardeployment.ear");
assertTrue(earFile.exists());
-
+
URL warURL = new URL("jar:" + earFile.toURL() + "!/jaxws-eardeployment.war!/");
URL wsdlURL = new URL(warURL, "WEB-INF/wsdl/TestEndpoint.wsdl");
-
+
Element root = DOMUtils.parse(new ResourceURL(wsdlURL).openStream());
assertNotNull(root);
}
public void testVirtualFile() throws Exception
{
+ if (isJBoss50() == false)
+ return;
+
File earFile = new File("libs/jaxws-eardeployment.ear");
assertTrue(earFile.exists());
-
+
URL earURL = earFile.toURL();
VFS fsEar = VFS.getVFS(earURL);
VirtualFile vfWar = fsEar.findChild("jaxws-eardeployment.war");
assertNotNull(earURL + "!/jaxws-eardeployment.war", vfWar);
-
+
VirtualFile vfWsdl = vfWar.findChild("WEB-INF/wsdl/TestEndpoint.wsdl");
assertNotNull(earURL + "!/jaxws-eardeployment.war!/WEB-INF/wsdl/TestEndpoint.wsdl", vfWsdl);
-
+
Element root = DOMUtils.parse(vfWsdl.openStream());
assertNotNull(root);
}
public void testEJB3Endpoint() throws Exception
{
- URL wsdlURL = new URL ("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
TestEndpoint port = service.getTestEndpointPort();
-
+
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
@@ -92,11 +97,11 @@
public void testJSEEndpoint() throws Exception
{
- URL wsdlURL = new URL ("http://" + getServerHost() + ":8080/earjse/JSEBean?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/earjse/JSEBean?wsdl");
QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
TestEndpoint port = service.getTestEndpointPort();
-
+
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
Added: branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This is only needed for JBoss-4.2 deployments -->
+
+<application xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
+ version="1.4">
+
+ <module>
+ <web>
+ <web-uri>jaxws-eardeployment.war</web-uri>
+ <context-root>earjse</context-root>
+ </web>
+ </module>
+ <module>
+ <java>jaxws-eardeployment.jar</java>
+ </module>
+
+</application>
\ No newline at end of file
Property changes on: branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-24 00:55:26 UTC (rev 1773)
@@ -1 +0,0 @@
-org/jboss/test/ws/*/benchmark/**
\ No newline at end of file
Copied: branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt (from rev 1762, branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt)
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-23 19:20:31 UTC (rev 1762)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt 2006-12-24 00:55:26 UTC (rev 1773)
@@ -0,0 +1 @@
+nothing-to-exclude/**
\ No newline at end of file
18 years
JBossWS SVN: r1772 - branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:22 -0500 (Sat, 23 Dec 2006)
New Revision: 1772
Modified:
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
Log:
Fix jse deployement for jboss42
Modified: branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-24 00:55:18 UTC (rev 1771)
+++ branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-24 00:55:22 UTC (rev 1772)
@@ -27,6 +27,9 @@
import java.util.Iterator;
import java.util.Map;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
import org.jboss.deployment.DeploymentInfo;
import org.jboss.metadata.WebMetaData;
import org.jboss.ws.WSException;
@@ -49,6 +52,51 @@
*/
public class DeployerInterceptorJSE extends DeployerInterceptor implements DeployerInterceptorJSEMBean
{
+ /** Return true if the deployment is a web service endpoint
+ */
+ protected boolean isWebserviceDeployment(DeploymentInfo di)
+ {
+ WebMetaData webMetaData = (WebMetaData)di.metaData;
+ boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
+
+ // Check if we have a webservices.xml descriptor
+ if (isWebserviceDeployment == false)
+ {
+ if (getWebservicesDescriptor(di) != null)
+ {
+ di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+
+ // Check if the web.xml contains annotated endpoint impl
+ if (isWebserviceDeployment == false)
+ {
+ Map servletClassMap = webMetaData.getServletClassMap();
+ Iterator<String> it = servletClassMap.values().iterator();
+ while (it.hasNext() && isWebserviceDeployment == false)
+ {
+ String servletClassName = it.next();
+ try
+ {
+ Class servletClass = di.annotationsCl.loadClass(servletClassName);
+ if (servletClass.isAnnotationPresent(WebService.class) || servletClass.isAnnotationPresent(WebServiceProvider.class))
+ {
+ di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ isWebserviceDeployment = true;
+ }
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+ }
+
+ webMetaData.setWebServiceDeployment(isWebserviceDeployment);
+ return isWebserviceDeployment;
+ }
+
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception
{
UnifiedDeploymentInfo udi;
@@ -105,51 +153,6 @@
}
}
- /** Return true if the deployment is a web service endpoint
- */
- protected boolean isWebserviceDeployment(DeploymentInfo di)
- {
- WebMetaData webMetaData = (WebMetaData)di.metaData;
- boolean isWebserviceDeployment = webMetaData.isWebServiceDeployment();
-
- // Check if we have a webservices.xml descriptor
- if (isWebserviceDeployment == false)
- {
- if (getWebservicesDescriptor(di) != null)
- {
- di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE);
- isWebserviceDeployment = true;
- }
- }
-
- // Check if the web.xml contains annotated endpoint impl
- if (isWebserviceDeployment == false)
- {
- Map servletClassMap = webMetaData.getServletClassMap();
- Iterator<String> it = servletClassMap.values().iterator();
- while (it.hasNext() && isWebserviceDeployment == false)
- {
- String servletClassName = it.next();
- try
- {
- Class servletClass = di.annotationsCl.loadClass(servletClassName);
- if (servletClass.isAnnotationPresent(javax.jws.WebService.class))
- {
- di.context.put("UnifiedDeploymentInfo.Type", UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
- isWebserviceDeployment = true;
- }
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
- }
- }
-
- webMetaData.setWebServiceDeployment(isWebserviceDeployment);
- return isWebserviceDeployment;
- }
-
/**
* Get the resource name of the webservices.xml descriptor.
*/
Modified: branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-24 00:55:18 UTC (rev 1771)
+++ branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebMetaDataAdaptor.java 2006-12-24 00:55:22 UTC (rev 1772)
@@ -27,6 +27,8 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.WebSecurityMetaData;
@@ -49,6 +51,7 @@
UnifiedWebMetaData umd = new UnifiedWebMetaData();
umd.setContextRoot(wmd.getContextRoot());
umd.setServletMappings(wmd.getServletMappings());
+ umd.setServletClassNames(getServletClassMap(wmd));
umd.setConfigName(wmd.getConfigName());
umd.setConfigFile(wmd.getConfigFile());
umd.setSecurityDomain(wmd.getSecurityDomain());
@@ -98,4 +101,19 @@
return unifiedsecurityMetaData;
}
+ private static Map<String, String> getServletClassMap(WebMetaData wmd)
+ {
+ Map<String, String> mappings = new HashMap<String, String>();
+ Iterator it = wmd.getServletClassMap().entrySet().iterator();
+ while(it.hasNext())
+ {
+ Map.Entry entry = (Entry)it.next();
+ String servletName = (String)entry.getKey();
+ String servletClass = (String)entry.getValue();
+ // Skip JSPs
+ if (servletClass != null)
+ mappings.put(servletName, servletClass);
+ }
+ return mappings;
+ }
}
18 years
JBossWS SVN: r1771 - branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:18 -0500 (Sat, 23 Dec 2006)
New Revision: 1771
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
Log:
Fix jse deployement for jboss42
Modified: branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java
===================================================================
--- branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2006-12-24 00:55:10 UTC (rev 1770)
+++ branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/ReceiveUsernameOperation.java 2006-12-24 00:55:18 UTC (rev 1771)
@@ -46,6 +46,9 @@
UsernameToken user = (UsernameToken)token;
String propName = SecurityAssociationAdaptorFactory.class.getName();
SecurityAssociationAdaptorFactory factory = (SecurityAssociationAdaptorFactory)FactoryLoader.loadFactory(propName, null);
+ if (factory == null)
+ throw new WSSecurityException("Cannot load: " + propName);
+
SecurityAssociationAdaptor securityAdaptor = factory.getSecurityAssociationAdaptor();
securityAdaptor.setPrincipal(new SimplePrincipal(user.getUsername()));
securityAdaptor.setCredential(user.getPassword());
18 years
JBossWS SVN: r1770 - branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:10 -0500 (Sat, 23 Dec 2006)
New Revision: 1770
Added:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
Removed:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
Log:
Fix jse deployement for jboss42
Copied: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java (from rev 1762, branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java)
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-23 19:20:31 UTC (rev 1762)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -0,0 +1,93 @@
+/*
+ * 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.jboss50;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * An abstract deployer for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerEJB extends AbstractDeployer
+{
+ @Override
+ protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit) throws Exception
+ {
+ // Create the service endpoint
+ super.createServiceEndpoint(udi, unit);
+
+ // Generate the webapp and publish through th publisher
+ try
+ {
+ UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.webappURL = new ServiceEndpointGeneratorEJB3().generatWebDeployment(wsMetaData, unit);
+ unit.addAttachment(ServiceEndpointWebApp.class, new ServiceEndpointWebApp(udi.webappURL));
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+ catch (Exception ex)
+ {
+ DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
+ }
+ }
+
+ @Override
+ protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ // Destroy the webapp
+ URL warURL = unit.getAttachment(ServiceEndpointWebApp.class).getWarURL();
+ try
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot destroy service endpoint: " + warURL, ex);
+ }
+
+ // Destroy the service endpoint
+ super.destroyServiceEndpoint(udi, unit);
+ }
+
+ static class ServiceEndpointWebApp
+ {
+ private URL warURL;
+
+ ServiceEndpointWebApp(URL warURL)
+ {
+ this.warURL = warURL;
+ }
+
+ public URL getWarURL()
+ {
+ return warURL;
+ }
+ }
+}
Copied: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java (from rev 1762, branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java)
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-23 19:20:31 UTC (rev 1762)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -0,0 +1,115 @@
+/*
+ * 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.jboss50;
+
+//$Id$
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.NameValuePair;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
+
+/**
+ * An abstract deployer for JSE Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerJSE extends AbstractDeployer
+{
+ public AbstractDeployerJSE()
+ {
+ super();
+ super.setRelativeOrder(CLASSLOADER_DEPLOYER + 1);
+ }
+
+ /**
+ * After the service endpoint has successfully been deployed to the ServiceEndpointManager,
+ *
+ */
+ @Override
+ protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
+ {
+ // Call the super implementation
+ super.deployServiceEndpoint(unit);
+
+ // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
+ InputStream stream = unit.getDeploymentContext().getRoot().findChild("WEB-INF/web.xml").openStream();
+ RewriteResults results = getServiceEndpointPublisher().rewriteWebXml(stream, null, unit.getClassLoader());
+
+ URL webXML = results.webXML;
+ modifyWebMetaData(unit, webXML);
+ }
+
+ private void modifyWebMetaData(DeploymentUnit unit, URL webXML) throws Exception
+ {
+ Set<? extends WebMetaData> allMetaData = unit.getAllMetaData(WebMetaData.class);
+ if (allMetaData.size() < 1)
+ throw new DeploymentException("Cannot find WebMetaData");
+
+ WebMetaData webMetaData = allMetaData.iterator().next();
+ String serviceEndpointServlet = getServiceEndpointPublisher().getServiceEndpointServlet();
+
+ Iterator it = webMetaData.getServlets().iterator();
+ while (it.hasNext())
+ {
+ Servlet servlet = (Servlet)it.next();
+ String servletClassName = servlet.getServletClass();
+
+ // JSP
+ if (servletClassName == null)
+ continue;
+
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servlet) == false)
+ {
+ servlet.setServletClass(serviceEndpointServlet);
+ NameValuePair initParam = new NameValuePair(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL, servletClassName);
+ servlet.addInitParam(initParam);
+ }
+ }
+
+ // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
+ String webXmlPath = webXML.getPath();
+ webMetaData.setAltDDPath(webXmlPath);
+ }
+
+ private boolean isAlreadyModified(Servlet servlet)
+ {
+ Iterator itParams = servlet.getInitParams().iterator();
+ while (itParams.hasNext())
+ {
+ NameValuePair pair = (NameValuePair)itParams.next();
+ if (AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(pair.getName()))
+ return true;
+ }
+ return false;
+ }
+}
Deleted: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-23 22:57:14 UTC (rev 1769)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -1,93 +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.jboss50;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * An abstract deployer for EJB Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractEJBDeployer extends AbstractDeployer
-{
- @Override
- protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit) throws Exception
- {
- // Create the service endpoint
- super.createServiceEndpoint(udi, unit);
-
- // Generate the webapp and publish through th publisher
- try
- {
- UnifiedMetaData wsMetaData = getServiceEndpointDeployer().getUnifiedMetaData(udi);
- udi.webappURL = new ServiceEndpointGeneratorEJB3().generatWebDeployment(wsMetaData, unit);
- unit.addAttachment(ServiceEndpointWebApp.class, new ServiceEndpointWebApp(udi.webappURL));
- getServiceEndpointPublisher().publishServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
- }
- }
-
- @Override
- protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- // Destroy the webapp
- URL warURL = unit.getAttachment(ServiceEndpointWebApp.class).getWarURL();
- try
- {
- getServiceEndpointPublisher().destroyServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- log.error("Cannot destroy service endpoint: " + warURL, ex);
- }
-
- // Destroy the service endpoint
- super.destroyServiceEndpoint(udi, unit);
- }
-
- static class ServiceEndpointWebApp
- {
- private URL warURL;
-
- ServiceEndpointWebApp(URL warURL)
- {
- this.warURL = warURL;
- }
-
- public URL getWarURL()
- {
- return warURL;
- }
- }
-}
Deleted: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-23 22:57:14 UTC (rev 1769)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -1,115 +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.jboss50;
-
-//$Id$
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.NameValuePair;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
-
-/**
- * An abstract deployer for JSE Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractJSEDeployer extends AbstractDeployer
-{
- public AbstractJSEDeployer()
- {
- super();
- super.setRelativeOrder(CLASSLOADER_DEPLOYER + 1);
- }
-
- /**
- * After the service endpoint has successfully been deployed to the ServiceEndpointManager,
- *
- */
- @Override
- protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
- {
- // Call the super implementation
- super.deployServiceEndpoint(unit);
-
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- InputStream stream = unit.getDeploymentContext().getRoot().findChild("WEB-INF/web.xml").openStream();
- RewriteResults results = getServiceEndpointPublisher().rewriteWebXml(stream, null, unit.getClassLoader());
-
- URL webXML = results.webXML;
- modifyWebMetaData(unit, webXML);
- }
-
- private void modifyWebMetaData(DeploymentUnit unit, URL webXML) throws Exception
- {
- Set<? extends WebMetaData> allMetaData = unit.getAllMetaData(WebMetaData.class);
- if (allMetaData.size() < 1)
- throw new DeploymentException("Cannot find WebMetaData");
-
- WebMetaData webMetaData = allMetaData.iterator().next();
- String serviceEndpointServlet = getServiceEndpointPublisher().getServiceEndpointServlet();
-
- Iterator it = webMetaData.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- String servletClassName = servlet.getServletClass();
-
- // JSP
- if (servletClassName == null)
- continue;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet) == false)
- {
- servlet.setServletClass(serviceEndpointServlet);
- NameValuePair initParam = new NameValuePair(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL, servletClassName);
- servlet.addInitParam(initParam);
- }
- }
-
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- String webXmlPath = webXML.getPath();
- webMetaData.setAltDDPath(webXmlPath);
- }
-
- private boolean isAlreadyModified(Servlet servlet)
- {
- Iterator itParams = servlet.getInitParams().iterator();
- while (itParams.hasNext())
- {
- NameValuePair pair = (NameValuePair)itParams.next();
- if (AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(pair.getName()))
- return true;
- }
- return false;
- }
-}
Modified: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-23 22:57:14 UTC (rev 1769)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -40,7 +40,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXRPCDeployerJSE extends AbstractJSEDeployer
+public class JAXRPCDeployerJSE extends AbstractDeployerJSE
{
@Override
protected DeploymentType getDeploymentType()
Modified: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-23 22:57:14 UTC (rev 1769)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -43,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXWSDeployerEJB3 extends AbstractEJBDeployer
+public class JAXWSDeployerEJB3 extends AbstractDeployerEJB
{
@Override
protected DeploymentType getDeploymentType()
Modified: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-23 22:57:14 UTC (rev 1769)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-24 00:55:10 UTC (rev 1770)
@@ -43,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXWSDeployerJSE extends AbstractJSEDeployer
+public class JAXWSDeployerJSE extends AbstractDeployerJSE
{
@Override
protected DeploymentType getDeploymentType()
18 years
JBossWS SVN: r1769 - in trunk: jbossws-core/src/main/java/org/jboss/ws/metadata/webservices jbossws-core/src/main/java/org/jboss/ws/tools jbossws-tests/src/main/resources/tools/jbws1090 jbossws-tests/src/main/resources/tools/metadatafixture
by jbossws-commits@lists.jboss.org
Author: alex.guizar(a)jboss.com
Date: 2006-12-23 17:57:14 -0500 (Sat, 23 Dec 2006)
New Revision: 1769
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
trunk/jbossws-tests/src/main/resources/tools/jbws1090/webservices.xml
trunk/jbossws-tests/src/main/resources/tools/jbws1090/wstools-config.xml
trunk/jbossws-tests/src/main/resources/tools/metadatafixture/webservices.xml
Log:
JBWS-1317
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2006-12-23 22:57:14 UTC (rev 1769)
@@ -168,18 +168,17 @@
*/
public String serialize()
{
- StringBuilder builder = new StringBuilder("<port-component> <port-component-name>");
- builder.append(portComponentName + "</port-component-name><wsdl-port>impl:");
- builder.append(wsdlPort.getLocalPart() + "</wsdl-port><service-endpoint-interface>");
- builder.append(serviceEndpointInterface);
- builder.append("</service-endpoint-interface>");
+ StringBuilder builder = new StringBuilder("<port-component>");
+ builder.append("<port-component-name>").append(portComponentName).append("</port-component-name>");
+ builder.append("<wsdl-port xmlns:").append(wsdlPort.getPrefix()).append("='").append(wsdlPort.getNamespaceURI()).append("'>");
+ builder.append(wsdlPort.getPrefix()).append(':').append(wsdlPort.getLocalPart()).append("</wsdl-port>");
+ builder.append("<service-endpoint-interface>").append(serviceEndpointInterface).append("</service-endpoint-interface>");
builder.append("<service-impl-bean>");
if (ejbLink != null)
{
builder.append("<ejb-link>");
builder.append(ejbLink);
builder.append("</ejb-link>");
-
}
else
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebserviceDescriptionMetaData.java 2006-12-23 22:57:14 UTC (rev 1769)
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import javax.xml.namespace.QName;
@@ -85,16 +84,14 @@
*
* @return
*/
- public Collection getPortComponentQNames()
+ public Collection<QName> getPortComponentQNames()
{
//TODO:Check if there is just one QName that drives all portcomponents
//or each port component can have a distinct QName (namespace/prefix)
//Maintain uniqueness of the QName
- Map map = new HashMap();
- Iterator iter = portComponents.iterator();
- while (iter != null && iter.hasNext())
+ Map<String, QName> map = new HashMap<String, QName>();
+ for (PortComponentMetaData pcm : portComponents)
{
- PortComponentMetaData pcm = (PortComponentMetaData)iter.next();
QName qname = pcm.getWsdlPort();
map.put(qname.getPrefix(), qname);
}
@@ -109,16 +106,13 @@
*/
public PortComponentMetaData getPortComponentByWsdlPort(String name)
{
- ArrayList pcNames = new ArrayList();
- Iterator it = portComponents.iterator();
- while (it.hasNext())
+ ArrayList<String> pcNames = new ArrayList<String>();
+ for (PortComponentMetaData pc : portComponents)
{
- PortComponentMetaData pc = (PortComponentMetaData)it.next();
String wsdlPortName = pc.getWsdlPort().getLocalPart();
if (wsdlPortName.equals(name))
- {
return pc;
- }
+
pcNames.add(wsdlPortName);
}
@@ -163,11 +157,10 @@
*/
public String serialize()
{
- StringBuilder buffer = new StringBuilder("<webservice-description> <webservice-description-name>");
- buffer.append(this.webserviceDescriptionName);
- buffer.append("</webservice-description-name>");
- buffer.append("<wsdl-file>" + wsdlFile + "</wsdl-file>");
- buffer.append("<jaxrpc-mapping-file>" + jaxrpcMappingFile + "</jaxrpc-mapping-file>");
+ StringBuilder buffer = new StringBuilder("<webservice-description>");
+ buffer.append("<webservice-description-name>").append(webserviceDescriptionName).append("</webservice-description-name>");
+ buffer.append("<wsdl-file>").append(wsdlFile).append("</wsdl-file>");
+ buffer.append("<jaxrpc-mapping-file>").append(jaxrpcMappingFile).append("</jaxrpc-mapping-file>");
for (PortComponentMetaData pm : portComponents)
buffer.append(pm.serialize());
buffer.append("</webservice-description>");
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/webservices/WebservicesMetaData.java 2006-12-23 22:57:14 UTC (rev 1769)
@@ -24,11 +24,8 @@
import java.net.URL;
import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.Map;
-import javax.xml.namespace.QName;
-
import org.jboss.ws.Constants;
// $Id$
@@ -76,34 +73,46 @@
//Serialize as a String
public String serialize()
{
+ //Construct the webservices.xml definitions
StringBuilder buffer = new StringBuilder();
- //Construct the webservices.xml definitions
- List qnames = new ArrayList();
- Iterator iter = webserviceDescriptions.iterator();
- while (iter != null && iter.hasNext())
- {
- WebserviceDescriptionMetaData wmd = (WebserviceDescriptionMetaData)iter.next();
- qnames.addAll(wmd.getPortComponentQNames());
- }
- createHeader(buffer, qnames);
+
+ // header: opening webservices tag
+ createHeader(buffer);
+
+ // webservice-description subelements
for (WebserviceDescriptionMetaData wm : webserviceDescriptions)
buffer.append(wm.serialize());
+
+ // closing webservices tag
buffer.append("</webservices>");
return buffer.toString();
}
- private void createHeader(StringBuilder buf, List qnames)
+ private void createHeader(StringBuilder buf)
{
buf.append("<webservices xmlns='http://java.sun.com/xml/ns/j2ee'");
- buf.append(" xmlns:xsi='" + Constants.NS_SCHEMA_XSI + "'");
- //Lets append the port type namespaces
- Iterator iter = qnames.iterator();
- while (iter != null && iter.hasNext())
+ buf.append(" xmlns:xsi='").append(Constants.NS_SCHEMA_XSI).append('\'');
+ buf.append(" xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
+ buf.append(" version='1.1'>");
+ }
+
+ private String createAlternatePrefix(String prefix, Map<String, String> namespaces)
+ {
+ // allocate working buffer
+ StringBuilder altPrefixBuilder = new StringBuilder(prefix);
+ // remember original length
+ int baseLength = prefix.length();
+
+ for (int i = 2; i < Integer.MAX_VALUE; i++)
{
- QName qn = (QName)iter.next();
- buf.append(" xmlns:").append(qn.getPrefix()).append("='").append(qn.getNamespaceURI()).append("'");
+ // append a natural number to the original prefix
+ String altPrefix = altPrefixBuilder.append(i).toString();
+ // if the alternate prefix does not match an existing one, we're done
+ if (!namespaces.containsKey(altPrefix))
+ return altPrefix;
+ // truncate buffer to original length
+ altPrefixBuilder.setLength(baseLength);
}
- buf.append(" xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'");
- buf.append(" version='1.1' >");
+ throw new IllegalArgumentException("could not create alternate prefix from: " + prefix);
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-12-23 22:57:14 UTC (rev 1769)
@@ -31,14 +31,15 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesFactory;
import org.jboss.ws.metadata.webservices.WebservicesMetaData;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
/**
* Creates the webservices.xml deployment descriptor
@@ -142,37 +143,42 @@
/* (non-Javadoc)
* @see org.jboss.ws.tools.WSDotXMLCreatorIntf#generateWSXMLDescriptor(java.io.File)
*/
- public void generateWSXMLDescriptor(File file) throws IOException
+ public void generateWSXMLDescriptor(File wsXmlFile) throws IOException
{
WebservicesMetaData webservices = constructWSMetaData();
- Element webservicesElem;
- if (append && file.exists())
+ // handle append flag
+ if (append && wsXmlFile.exists())
{
- // append generated webservice descriptions to existing file
- // parse existing file
- InputStream wsxmlStream = new FileInputStream(file);
- webservicesElem = DOMUtils.parse(wsxmlStream);
- wsxmlStream.close();
+ WebservicesMetaData existingWebservices;
- // obtain <webservice-description> subelements and append them to <webservices>
- Document webservicesDoc = webservicesElem.getOwnerDocument();
- for (WebserviceDescriptionMetaData wsdescription : webservices.getWebserviceDescriptions())
+ // parse existing webservices descriptor
+ InputStream wsXmlStream = new FileInputStream(wsXmlFile);
+ try
{
- String wsdescriptionString = wsdescription.serialize();
- Element wsdescriptionElem = DOMUtils.parse(wsdescriptionString);
- webservicesElem.appendChild(webservicesDoc.importNode(wsdescriptionElem, true));
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new WebservicesFactory(wsXmlFile.toURL());
+ existingWebservices = (WebservicesMetaData)unmarshaller.unmarshal(wsXmlStream, factory, null);
}
+ catch (JBossXBException e)
+ {
+ throw new WSException("Could not unmarshal existing webservices descriptor: " + wsXmlFile, e);
+ }
+ finally
+ {
+ wsXmlStream.close();
+ }
+
+ // append generated webservice-descriptions to existing descriptor
+ for (WebserviceDescriptionMetaData webserviceDescription : webservices.getWebserviceDescriptions())
+ existingWebservices.addWebserviceDescription(webserviceDescription);
+
+ webservices = existingWebservices;
}
- else
- {
- // write generated webservices descriptor to new file
- String wmdata = webservices.serialize();
- webservicesElem = DOMUtils.parse(wmdata);
- }
- FileWriter fw = new FileWriter(file);
- fw.write(DOMWriter.printNode(webservicesElem, true));
+ // (re-)write generated webservices descriptor to file
+ FileWriter fw = new FileWriter(wsXmlFile);
+ fw.write(webservices.serialize());
fw.close();
}
@@ -195,7 +201,7 @@
wsdm.setJaxrpcMappingFile(this.mappingFile);
PortComponentMetaData pm1 = new PortComponentMetaData(wsdm);
pm1.setPortComponentName(portName);
- pm1.setWsdlPort(new QName(this.targetNamespace, portName, "impl"));
+ pm1.setWsdlPort(new QName(this.targetNamespace, portName, "portNS"));
pm1.setServiceEndpointInterface(seiName);
if (this.servletLink != null && this.servletLink.length() > 0)
pm1.setServletLink(this.servletLink);
Modified: trunk/jbossws-tests/src/main/resources/tools/jbws1090/webservices.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/tools/jbws1090/webservices.xml 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-tests/src/main/resources/tools/jbws1090/webservices.xml 2006-12-23 22:57:14 UTC (rev 1769)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://test.jboss.org/ws4eesimple"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
@@ -12,7 +11,7 @@
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>ValidURL</port-component-name>
- <wsdl-port>impl:ValidURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:ValidURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -20,7 +19,7 @@
</port-component>
<port-component>
<port-component-name>InvalidURL</port-component-name>
- <wsdl-port>impl:InvalidURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:InvalidURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -28,7 +27,7 @@
</port-component>
<port-component>
<port-component-name>ValidSecureURL</port-component-name>
- <wsdl-port>impl:ValidSecureURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:ValidSecureURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -36,7 +35,7 @@
</port-component>
<port-component>
<port-component-name>InvalidSecureURL</port-component-name>
- <wsdl-port>impl:InvalidSecureURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:InvalidSecureURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -50,7 +49,7 @@
<jaxrpc-mapping-file>WEB-INF/additional-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>AdditionalEndpointPort</port-component-name>
- <wsdl-port>impl:AdditionalEndpointPort</wsdl-port>
+ <wsdl-port xmlns:portNS="http://ws.test.jboss.org/jbws1090">portNS:AdditionalEndpointPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.ws.tools.jbws1090.AdditionalEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>AdditionalServlet</servlet-link>
Modified: trunk/jbossws-tests/src/main/resources/tools/jbws1090/wstools-config.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/tools/jbws1090/wstools-config.xml 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-tests/src/main/resources/tools/jbws1090/wstools-config.xml 2006-12-23 22:57:14 UTC (rev 1769)
@@ -5,8 +5,8 @@
<java-wsdl>
<service name="AdditionalService"
endpoint="org.jboss.test.ws.tools.jbws1090.AdditionalEndpoint" style="rpc" />
- <namespaces target-namespace="http://org.jboss.test.ws/jbws1090"
- type-namespace="http://org.jboss.test.ws/jbws1090/type" />
+ <namespaces target-namespace="http://ws.test.jboss.org/jbws1090"
+ type-namespace="http://ws.test.jboss.org/jbws1090/type" />
<mapping file="additional-mapping.xml" />
<webservices servlet-link="AdditionalServlet" append="true" />
</java-wsdl>
Modified: trunk/jbossws-tests/src/main/resources/tools/metadatafixture/webservices.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/tools/metadatafixture/webservices.xml 2006-12-23 22:06:30 UTC (rev 1768)
+++ trunk/jbossws-tests/src/main/resources/tools/metadatafixture/webservices.xml 2006-12-23 22:57:14 UTC (rev 1769)
@@ -2,7 +2,6 @@
<webservices
xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://test.jboss.org/ws4eesimple"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
@@ -13,7 +12,7 @@
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>ValidURL</port-component-name>
- <wsdl-port>impl:ValidURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:ValidURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -21,7 +20,7 @@
</port-component>
<port-component>
<port-component-name>InvalidURL</port-component-name>
- <wsdl-port>impl:InvalidURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:InvalidURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -29,7 +28,7 @@
</port-component>
<port-component>
<port-component-name>ValidSecureURL</port-component-name>
- <wsdl-port>impl:ValidSecureURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:ValidSecureURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
@@ -37,7 +36,7 @@
</port-component>
<port-component>
<port-component-name>InvalidSecureURL</port-component-name>
- <wsdl-port>impl:InvalidSecureURLPort</wsdl-port>
+ <wsdl-port xmlns:impl="http://test.jboss.org/ws4eesimple">impl:InvalidSecureURLPort</wsdl-port>
<service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
<service-impl-bean>
<servlet-link>HelloJavaBean</servlet-link>
18 years
JBossWS SVN: r1768 - branches/tdiesler/trunk/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 17:06:30 -0500 (Sat, 23 Dec 2006)
New Revision: 1768
Modified:
branches/tdiesler/trunk/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/wspublish.java
Log:
partial commit
Modified: branches/tdiesler/trunk/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/wspublish.java
===================================================================
--- branches/tdiesler/trunk/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/wspublish.java 2006-12-23 22:06:25 UTC (rev 1767)
+++ branches/tdiesler/trunk/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/wspublish.java 2006-12-23 22:06:30 UTC (rev 1768)
@@ -32,6 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.util.file.JarUtils;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
/**
* Publish a standard portable J2EE web service endpoint
@@ -67,9 +68,13 @@
JarUtils.unjar(in, tmpDir);
in.close();
+ UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(null);
+ udi.webappURL = tmpDir.toURL();
+
TomcatServiceEndpointPublisher publisher = new TomcatServiceEndpointPublisher();
publisher.setServiceEndpointServlet(servletName);
- publisher.rewriteWebXml(tmpDir.toURL());
+
+ publisher.rewriteWebXml(udi);
File outFile = new File(destDir.getCanonicalPath() + "/" + warName);
outFile.getParentFile().mkdirs();
18 years
JBossWS SVN: r1767 - in branches/tdiesler/trunk/jbossws-tests: . ant-import
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 17:06:25 -0500 (Sat, 23 Dec 2006)
New Revision: 1767
Modified:
branches/tdiesler/trunk/jbossws-tests/.classpath
branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
Log:
partial commit
Modified: branches/tdiesler/trunk/jbossws-tests/.classpath
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/.classpath 2006-12-23 22:06:20 UTC (rev 1766)
+++ branches/tdiesler/trunk/jbossws-tests/.classpath 2006-12-23 22:06:25 UTC (rev 1767)
@@ -40,5 +40,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/integration-jboss50"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-tomcat"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration-jboss42"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-23 22:06:20 UTC (rev 1766)
+++ branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-23 22:06:25 UTC (rev 1767)
@@ -666,7 +666,7 @@
<!-- jaxrpc-jbws1124one -->
<copy todir="${tests.output.dir}/resources" overwrite="true">
- <fileset dir="${tests.output.dir}/resources">
+ <fileset dir="${tests.resources.dir}">
<include name="jaxrpc/jbws1124/META-INF/jboss-client.xml"/>
<include name="jaxrpc/jbws1124/WEB-INF/test-resource.txt"/>
<include name="jaxrpc/jbws1124/WEB-INF/jboss-web.xml"/>
@@ -690,7 +690,7 @@
</war>
<!-- jaxrpc-jbws1124two -->
<copy todir="${tests.output.dir}/resources" overwrite="true">
- <fileset dir="${tests.output.dir}/resources">
+ <fileset dir="${tests.resources.dir}">
<include name="jaxrpc/jbws1124/META-INF/jboss-client.xml"/>
<include name="jaxrpc/jbws1124/WEB-INF/test-resource.txt"/>
<include name="jaxrpc/jbws1124/WEB-INF/jboss-web.xml"/>
18 years
JBossWS SVN: r1766 - branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 17:06:20 -0500 (Sat, 23 Dec 2006)
New Revision: 1766
Modified:
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java
Log:
partial commit
Modified: branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-23 22:06:16 UTC (rev 1765)
+++ branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeployerInterceptorJSE.java 2006-12-23 22:06:20 UTC (rev 1766)
@@ -84,7 +84,7 @@
if (udi != null)
{
AbstractServiceEndpointPublisher endpointPublisher = getServiceEndpointPublisher();
- RewriteResults results = endpointPublisher.rewriteWebXml(udi.url);
+ RewriteResults results = endpointPublisher.rewriteWebXml(udi);
updateServiceEndpointTargetBeans(udi, results);
}
}
Modified: branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java 2006-12-23 22:06:16 UTC (rev 1765)
+++ branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/DeploymentInfoAdaptor.java 2006-12-23 22:06:20 UTC (rev 1766)
@@ -51,9 +51,10 @@
udi.name = di.getCanonicalName();
udi.simpleName = di.shortName;
udi.url = getDeploymentURL(di);
- udi.metaData = buildMetaData(di.metaData);
udi.classLoader = di.annotationsCl;
udi.deployedObject = di.deployedObject;
+
+ buildMetaData(udi, di.metaData);
return udi;
}
@@ -72,17 +73,16 @@
return deploymentURL;
}
- private static Object buildMetaData(Object metaData)
+ private static void buildMetaData(UnifiedDeploymentInfo udi, Object metaData)
{
- Object retMetaData = null;
if (metaData instanceof WebMetaData)
{
- retMetaData = WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+ udi.webappURL = udi.url;
}
else if (metaData instanceof ApplicationMetaData)
{
- retMetaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
+ udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData((ApplicationMetaData)metaData);
}
- return retMetaData;
}
}
Modified: branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java 2006-12-23 22:06:16 UTC (rev 1765)
+++ branches/tdiesler/trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/ServiceEndpointPublisher.java 2006-12-23 22:06:20 UTC (rev 1766)
@@ -53,10 +53,10 @@
if (di == null)
throw new IllegalStateException("Cannot obtain DeploymentInfo from context");
- URL warURL = udi.url;
- rewriteWebXml(warURL);
+ rewriteWebXml(udi);
// Preserve the repository config
+ URL warURL = udi.webappURL;
DeploymentInfo auxdi = new DeploymentInfo(warURL, null, MBeanServerLocator.locateJBoss());
auxdi.repositoryConfig = di.getTopRepositoryConfig();
getMainDeployer().deploy(auxdi);
18 years
JBossWS SVN: r1765 - branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 17:06:16 -0500 (Sat, 23 Dec 2006)
New Revision: 1765
Modified:
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
Log:
partial commit
Modified: branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-23 22:06:11 UTC (rev 1764)
+++ branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-23 22:06:16 UTC (rev 1765)
@@ -84,8 +84,9 @@
public abstract String destroyServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception;
- public RewriteResults rewriteWebXml(URL warURL)
+ public RewriteResults rewriteWebXml(UnifiedDeploymentInfo udi)
{
+ URL warURL = udi.webappURL;
File warFile = new File(warURL.getFile());
if (warFile.isDirectory() == false)
throw new WSException("Expected a war directory: " + warURL);
@@ -105,7 +106,7 @@
throw new WSException("Cannot rename web.xml: " + orgWebXML);
FileInputStream stream = new FileInputStream(orgWebXML);
- return rewriteWebXml(stream, webXML, null);
+ return rewriteWebXml(stream, webXML, udi.classLoader);
}
catch (RuntimeException rte)
{
Modified: branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-23 22:06:11 UTC (rev 1764)
+++ branches/tdiesler/trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-23 22:06:16 UTC (rev 1765)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
18 years
JBossWS SVN: r1764 - branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 17:06:11 -0500 (Sat, 23 Dec 2006)
New Revision: 1764
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
Log:
partial commit
Modified: branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java
===================================================================
--- branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-23 21:18:02 UTC (rev 1763)
+++ branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointPublisher.java 2006-12-23 22:06:11 UTC (rev 1764)
@@ -66,7 +66,7 @@
URL warURL = udi.webappURL;
log.debug("publishServiceEndpoint: " + warURL);
- rewriteWebXml(warURL);
+ rewriteWebXml(udi);
DeploymentContext context = createDeploymentContext(warURL);
mainDeployer.addDeploymentContext(context);
18 years