JBossWS SVN: r10528 - stack/metro/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-13 02:59:27 -0400 (Thu, 13 Aug 2009)
New Revision: 10528
Modified:
stack/metro/trunk/pom.xml
Log:
[JBWS-2402] fixing issue
Modified: stack/metro/trunk/pom.xml
===================================================================
--- stack/metro/trunk/pom.xml 2009-08-13 06:59:08 UTC (rev 10527)
+++ stack/metro/trunk/pom.xml 2009-08-13 06:59:27 UTC (rev 10528)
@@ -62,9 +62,9 @@
<jaxb.api.version>2.1</jaxb.api.version>
<jaxb.impl.version>2.1.9</jaxb.impl.version>
<jaxrpc.api.version>1.1</jaxrpc.api.version>
- <jboss.jaxr.version>2.0.0</jboss.jaxr.version>
- <apache.scout.version>1.1</apache.scout.version>
- <juddi.version>0.9RC4</juddi.version>
+ <jboss.jaxr.version>2.0.1</jboss.jaxr.version>
+ <apache.scout.version>1.1.1</apache.scout.version>
+ <juddi.version>2.0.1</juddi.version>
<sun.fastinfoset.version>1.2.2</sun.fastinfoset.version>
<sun.sjsxp.version>1.0.1</sun.sjsxp.version>
<sun.http-transport.version>2.1.3</sun.http-transport.version>
14 years, 10 months
JBossWS SVN: r10527 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-13 02:59:08 -0400 (Thu, 13 Aug 2009)
New Revision: 10527
Modified:
stack/native/trunk/pom.xml
Log:
[JBWS-2402] fixing issue
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-08-13 06:14:38 UTC (rev 10526)
+++ stack/native/trunk/pom.xml 2009-08-13 06:59:08 UTC (rev 10527)
@@ -68,9 +68,9 @@
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jboss.jaxbintros.version>1.0.0.GA</jboss.jaxbintros.version>
<jboss.logging.version>2.2.0.CR1</jboss.logging.version>
- <jboss.jaxr.version>2.0.0</jboss.jaxr.version>
- <apache.scout.version>1.1</apache.scout.version>
- <juddi.version>0.9RC4</juddi.version>
+ <jboss.jaxr.version>2.0.1</jboss.jaxr.version>
+ <apache.scout.version>1.1.1</apache.scout.version>
+ <juddi.version>2.0.1</juddi.version>
<netty.version>3.1.0.GA</netty.version>
<sun.fastinfoset.version>1.2.2</sun.fastinfoset.version>
<sun.jaxws.version>2.1.3</sun.jaxws.version>
14 years, 10 months
JBossWS SVN: r10526 - container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-13 02:14:38 -0400 (Thu, 13 Aug 2009)
New Revision: 10526
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
sync doc
Modified: container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 15:19:22 UTC (rev 10525)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-13 06:14:38 UTC (rev 10526)
@@ -23,7 +23,7 @@
If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
- If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
+ If 'webServiceHost' is set to 'jbossws.undefined.host', JBossWS uses requesters host when rewriting the <soap:address>
-->
<property name="webServiceHost">${jboss.bind.address}</property>
<property name="modifySOAPAddress">true</property>
14 years, 10 months
JBossWS SVN: r10525 - in container/jboss50/branches: jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-12 11:19:22 -0400 (Wed, 12 Aug 2009)
New Revision: 10525
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
Fixing documentation
Modified: container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 12:51:45 UTC (rev 10524)
+++ container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 15:19:22 UTC (rev 10525)
@@ -23,7 +23,7 @@
If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
- If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
+ If 'webServiceHost' is set to 'jbossws.undefined.host', JBossWS uses requesters protocol host when rewriting the <soap:address>.
-->
<property name="webServiceHost">${jboss.bind.address}</property>
<property name="modifySOAPAddress">true</property>
Modified: container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 12:51:45 UTC (rev 10524)
+++ container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 15:19:22 UTC (rev 10525)
@@ -23,7 +23,7 @@
If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
- If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
+ If 'webServiceHost' is set to 'jbossws.undefined.host', JBossWS uses requesters protocol host when rewriting the <soap:address>.
-->
<property name="webServiceHost">${jboss.bind.address}</property>
<property name="modifySOAPAddress">true</property>
Modified: container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 12:51:45 UTC (rev 10524)
+++ container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-12 15:19:22 UTC (rev 10525)
@@ -23,7 +23,7 @@
If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
- If 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>.
+ If 'webServiceHost' is set to 'jbossws.undefined.host', JBossWS uses requesters protocol host when rewriting the <soap:address>.
-->
<property name="webServiceHost">${jboss.bind.address}</property>
<property name="modifySOAPAddress">true</property>
14 years, 10 months
JBossWS SVN: r10524 - container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-12 08:51:45 -0400 (Wed, 12 Aug 2009)
New Revision: 10524
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentBuilder.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
Log:
[JBWS-2320] refactoring + javadoc
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentBuilder.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentBuilder.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentBuilder.java 2009-08-12 12:51:45 UTC (rev 10524)
@@ -0,0 +1,521 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.deployers;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.serviceref.VirtualFileAdaptor;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilterWithAttributes;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.integration.WSConstants;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
+import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
+import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+
+/**
+ * JBossWS deployment model builder.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class WSDeploymentBuilder
+{
+
+ /** Builder instance. */
+ private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
+
+ /** WSDL, XSD and XML files filter. */
+ private static final WSVirtualFileFilter WS_FILE_FILTER = new WSVirtualFileFilter();
+
+ /** Builders registry. */
+ private static Map<DeploymentType, DeploymentModelBuilder> builders;
+
+ static
+ {
+ WSDeploymentBuilder.builders = new HashMap<DeploymentType, DeploymentModelBuilder>();
+ WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_JSE, new JaxwsJseDeploymentModelBuilder());
+ WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_JSE, new JaxrpcJseDeploymentModelBuilder());
+ WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_EJB3, new JaxwsEjbDeploymentModelBuilder());
+ WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_EJB21, new JaxrpcEjbDeploymentModelBuilder());
+ }
+
+ /**
+ * Constructor.
+ */
+ private WSDeploymentBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Factory method for obtaining builder instance.
+ *
+ * @return builder instance
+ */
+ static WSDeploymentBuilder getInstance()
+ {
+ return WSDeploymentBuilder.SINGLETON;
+ }
+
+ /**
+ * Builds JBossWS deployment model if web service deployment is detected.
+ *
+ * @param unit deployment unit
+ */
+ void build(final DeploymentUnit unit)
+ {
+ final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
+
+ if (deploymentType != null)
+ {
+ WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
+ }
+ }
+
+ /**
+ * Deployment builder interface.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static interface DeploymentModelBuilder
+ {
+
+ /**
+ * Creates Web Service deployment model and associates it with deployment.
+ *
+ * @param unit deployment unit
+ */
+ void newDeploymentModel(DeploymentUnit unit);
+
+ }
+
+ /**
+ * Base class for all deployment model builders.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private abstract static class AbstractDeploymentModelBuilder implements WSDeploymentBuilder.DeploymentModelBuilder
+ {
+
+ /** Deployment model factory. */
+ private final DeploymentModelFactory deploymentModelFactory;
+
+ /**
+ * Constructor.
+ */
+ AbstractDeploymentModelBuilder()
+ {
+ super();
+
+ // deployment factory
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ this.deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
+ }
+
+ /**
+ * @see org.jboss.webservices.integration.deployers.WSDeploymentBuilder.DeploymentModelBuilder#newDeploymentModel(DeploymentUnit)
+ *
+ * @param unit deployment unit
+ */
+ public final void newDeploymentModel(final DeploymentUnit unit)
+ {
+ final ArchiveDeployment dep = this.newDeployment(unit);
+
+ this.build(dep, unit);
+
+ dep.addAttachment(DeploymentUnit.class, unit);
+ unit.addAttachment(Deployment.class, dep);
+ }
+
+ /**
+ * Template method for subclasses to implement.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ protected abstract void build(Deployment dep, DeploymentUnit unit);
+
+ /**
+ * Creates new Web Service endpoint.
+ *
+ * @param endpointClass endpoint class name
+ * @param endpointName endpoint name
+ * @param dep deployment
+ * @return WS endpoint
+ */
+ protected final Endpoint newEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ {
+ if (endpointName == null)
+ {
+ throw new NullPointerException("Null endpoint name");
+ }
+
+ if (endpointClass == null)
+ {
+ throw new NullPointerException("Null endpoint class");
+ }
+
+ final Endpoint endpoint = this.deploymentModelFactory.newEndpoint(endpointClass);
+ endpoint.setShortName(endpointName);
+ dep.getService().addEndpoint(endpoint);
+
+ return endpoint;
+ }
+
+ /**
+ * Creates new Web Service deployment.
+ *
+ * @param unit deployment unit
+ * @return archive deployment
+ */
+ private ArchiveDeployment newDeployment(final DeploymentUnit unit)
+ {
+ final ArchiveDeployment dep = this.newDeployment(unit.getSimpleName(), unit.getClassLoader());
+
+ if (unit instanceof VFSDeploymentUnit)
+ {
+ final VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
+ final List<VirtualFile> virtualFiles = vfsUnit.getMetaDataFiles(WSDeploymentBuilder.WS_FILE_FILTER);
+ final Set<UnifiedVirtualFile> uVirtualFiles = new HashSet<UnifiedVirtualFile>();
+ for (VirtualFile vf : virtualFiles)
+ {
+ // Adding the roots of the virtual files.
+ try
+ {
+ uVirtualFiles.add(new VirtualFileAdaptor(vf.getVFS().getRoot()));
+ }
+ catch (IOException ioe)
+ {
+ throw new WSFDeploymentException(ioe);
+ }
+ }
+ dep.setMetadataFiles(new LinkedList<UnifiedVirtualFile>(uVirtualFiles));
+ }
+
+ if (unit.getParent() != null)
+ {
+ final String parentDeploymentName = unit.getParent().getSimpleName();
+ final ClassLoader parentClassLoader = unit.getParent().getClassLoader();
+
+ final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName, parentClassLoader);
+ dep.setParent(parentDep);
+ }
+
+ dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
+ dep.setRuntimeClassLoader(unit.getClassLoader());
+ final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
+ dep.setType(deploymentType);
+
+ return dep;
+ }
+
+ /**
+ * Creates new archive deployment.
+ *
+ * @param name deployment name
+ * @param loader deployment loader
+ * @return new archive deployment
+ */
+ private ArchiveDeployment newDeployment(final String name, final ClassLoader loader)
+ {
+ return (ArchiveDeployment)this.deploymentModelFactory.newDeployment(name, loader);
+ }
+
+ /**
+ * Gets specified attachment from deployment unit.
+ * Checks it's not null and then propagates it to <b>dep</b>
+ * attachments. Finally it returns attachment value.
+ *
+ * @param <A> class type
+ * @param attachment attachment
+ * @param unit deployment unit
+ * @param dep deployment
+ * @return attachment value if found in unit
+ */
+ protected final <A> A getAndPropagateAttachment(final Class<A> attachment, final DeploymentUnit unit, final Deployment dep)
+ {
+ final A attachmentValue = ASHelper.getOptionalAttachment(unit, attachment);
+
+ if (attachmentValue != null)
+ {
+ dep.addAttachment(attachment, attachmentValue);
+ return attachmentValue;
+ }
+
+ throw new IllegalStateException("Deployment unit does not contain " + attachment);
+ }
+
+ }
+
+ /**
+ * Creates new JAXWS JSE deployment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static final class JaxwsJseDeploymentModelBuilder extends WSDeploymentBuilder.AbstractDeploymentModelBuilder
+ {
+
+ /**
+ * Constructor.
+ */
+ private JaxwsJseDeploymentModelBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates new JAXWS JSE deployment and registers it with deployment unit.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ @Override
+ public void build(final Deployment dep, final DeploymentUnit unit)
+ {
+ this.getAndPropagateAttachment(JBossWebMetaData.class, unit, dep);
+
+ final List<ServletMetaData> servlets = ASHelper.getJaxwsServlets(unit);
+ for (ServletMetaData servlet : servlets)
+ {
+ final String servletName = servlet.getName();
+ final String servletClass = ASHelper.getEndpointName(servlet);
+
+ this.newEndpoint(servletClass, servletName, dep);
+ }
+ }
+
+ }
+
+ /**
+ * Creates new JAXRPC JSE deployment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static final class JaxrpcJseDeploymentModelBuilder extends WSDeploymentBuilder.AbstractDeploymentModelBuilder
+ {
+
+ /**
+ * Constructor.
+ */
+ private JaxrpcJseDeploymentModelBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates new JAXRPC JSE deployment and registers it with deployment unit.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ public void build(final Deployment dep, final DeploymentUnit unit)
+ {
+ final JBossWebMetaData webMetaData = this.getAndPropagateAttachment(JBossWebMetaData.class, unit, dep);
+ final WebservicesMetaData wsMetaData = this.getAndPropagateAttachment(WebservicesMetaData.class, unit, dep);
+
+ for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
+ {
+ for (PortComponentMetaData pcmd : wsd.getPortComponents())
+ {
+ final String servletName = pcmd.getServletLink();
+ final ServletMetaData servletMD = ASHelper.getServletForName(webMetaData, servletName);
+ final String servletClass = ASHelper.getEndpointName(servletMD);
+
+ this.newEndpoint(servletClass, servletName, dep);
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Creates new JAXWS EJB3 deployment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static final class JaxwsEjbDeploymentModelBuilder extends WSDeploymentBuilder.AbstractDeploymentModelBuilder
+ {
+
+ /**
+ * Constructor.
+ */
+ private JaxwsEjbDeploymentModelBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates new JAXWS EJB3 deployment and registers it with deployment unit.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ public void build(final Deployment dep, final DeploymentUnit unit)
+ {
+ this.getAndPropagateAttachment(WebServiceDeployment.class, unit, dep);
+
+ final Iterator<WebServiceDeclaration> ejbIterator = ASHelper.getJaxwsEjbs(unit).iterator();
+ while (ejbIterator.hasNext())
+ {
+ final WebServiceDeclaration container = ejbIterator.next();
+ final String ejbName = container.getComponentName();
+ final String ejbClass = container.getComponentClassName();
+
+ final Endpoint ep = this.newEndpoint(ejbClass, ejbName, dep);
+ ep.setProperty(WSConstants.CONTAINER_NAME, container.getContainerName());
+ }
+ }
+
+ }
+
+ /**
+ * Creates new JAXRPC EJB21 deployment.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static final class JaxrpcEjbDeploymentModelBuilder extends WSDeploymentBuilder.AbstractDeploymentModelBuilder
+ {
+
+ /**
+ * Constructor.
+ */
+ private JaxrpcEjbDeploymentModelBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates new JAXRPC EJB21 deployment and registers it with deployment unit.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ public void build(final Deployment dep, final DeploymentUnit unit)
+ {
+ final JBossMetaData jbmd = this.getAndPropagateAttachment(JBossMetaData.class, unit, dep);
+ final WebservicesMetaData wsMetaData = this.getAndPropagateAttachment(WebservicesMetaData.class, unit, dep);
+ this.getAndPropagateAttachment(WebServiceDeployment.class, unit, dep);
+
+ for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
+ {
+ for (PortComponentMetaData pcmd : wsd.getPortComponents())
+ {
+ final String ejbName = pcmd.getEjbLink();
+ final JBossEnterpriseBeanMetaData beanMetaData = jbmd.getEnterpriseBean(ejbName);
+ final String ejbClass = beanMetaData.getEjbClass();
+
+ this.newEndpoint(ejbClass, ejbName, dep);
+ }
+ }
+ }
+
+ }
+
+ /**
+ * WS file filter for files with the '.wsdl', or '.xsd' or '.xml' suffix.
+ *
+ * @author <a href="mailto:dbevenius@jboss.com">Daniel Bevenius</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+ private static final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
+ {
+
+ /** The tree walking attributes. */
+ private VisitorAttributes attributes;
+
+ /**
+ * Constructor.
+ */
+ public WSVirtualFileFilter()
+ {
+ this(VisitorAttributes.RECURSE_LEAVES_ONLY);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param attributes visit attributes
+ */
+ public WSVirtualFileFilter(final VisitorAttributes attributes)
+ {
+ this.attributes = attributes;
+ }
+
+ /**
+ * Gets VisitorAttributes for this instance.
+ *
+ * @return visitor attributes
+ */
+ public VisitorAttributes getAttributes()
+ {
+ return this.attributes;
+ }
+
+ /**
+ * Accepts files that end with '.wsdl' or '.xsd' or '.xml'.
+ *
+ * @param file to analyze
+ * @return true if expected file extension, false otherwise
+ */
+ public boolean accepts(final VirtualFile file)
+ {
+ if (file == null)
+ {
+ return false;
+ }
+
+ final String fileName = file.getName().toLowerCase();
+ final boolean hasWsdlSuffix = fileName.endsWith(".wsdl");
+ final boolean hasXsdSuffix = fileName.endsWith(".xsd");
+ final boolean hasXmlSuffix = fileName.endsWith(".xml");
+
+ return hasWsdlSuffix || hasXsdSuffix || hasXmlSuffix;
+ }
+
+ }
+
+}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-08-12 10:29:29 UTC (rev 10523)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-08-12 12:51:45 UTC (rev 10524)
@@ -21,39 +21,12 @@
*/
package org.jboss.webservices.integration.deployers;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.serviceref.VirtualFileAdaptor;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ServletMetaData;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.common.integration.WSConstants;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
-import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
-import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
-import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
-import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
/**
* This deployer initializes JBossWS deployment meta data.
@@ -63,11 +36,6 @@
public final class WSDeploymentDeployer extends AbstractRealDeployer
{
- /** WSDL and XSD files filter. */
- private static final WSVirtualFileFilter WS_FILE_FILTER = new WSVirtualFileFilter();
- /** Deployment model factory. */
- private final DeploymentModelFactory deploymentModelFactory;
-
/**
* Constructor.
*/
@@ -82,250 +50,18 @@
// outputs
this.addOutput(JBossWebMetaData.class);
this.addOutput(Deployment.class);
-
- // deployment factory
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- this.deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
}
/**
* Creates new Web Service deployment and registers it with deployment unit.
*
* @param unit deployment unit
- * @throws DeploymentException if error occurs
+ * @throws DeploymentException if any error occurs
*/
@Override
protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
{
- if (ASHelper.isJaxwsJseDeployment(unit))
- {
- this.newJaxwsJseDeployment(unit);
- }
- else if (ASHelper.isJaxwsEjbDeployment(unit))
- {
- this.newJaxwsEjbDeployment(unit);
- }
- else if (ASHelper.isJaxrpcJseDeployment(unit))
- {
- this.newJaxrpcJseDeployment(unit);
- }
- else if (ASHelper.isJaxrpcEjbDeployment(unit))
- {
- this.newJaxrpcEjbDeployment(unit);
- }
+ WSDeploymentBuilder.getInstance().build(unit);
}
- /**
- * Creates new JAXRPC EJB21 deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- */
- private void newJaxrpcEjbDeployment(final DeploymentUnit unit)
- {
- final ArchiveDeployment dep = this.newDeployment(unit);
- final JBossMetaData jbmd = this.getAndPropagateAttachment(JBossMetaData.class, unit, dep);
- final WebservicesMetaData wsMetaData = this.getAndPropagateAttachment(WebservicesMetaData.class, unit, dep);
- this.getAndPropagateAttachment(WebServiceDeployment.class, unit, dep);
-
- for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
- {
- for (PortComponentMetaData pcmd : wsd.getPortComponents())
- {
- final String ejbName = pcmd.getEjbLink();
- final JBossEnterpriseBeanMetaData beanMetaData = jbmd.getEnterpriseBean(ejbName);
- final String ejbClass = beanMetaData.getEjbClass();
-
- this.createEndpoint(ejbClass, ejbName, dep);
- }
- }
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
- }
-
- /**
- * Creates new JAXWS EJB3 deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- */
- private void newJaxwsEjbDeployment(final DeploymentUnit unit)
- {
- final ArchiveDeployment dep = this.newDeployment(unit);
- this.getAndPropagateAttachment(WebServiceDeployment.class, unit, dep);
-
- final Iterator<WebServiceDeclaration> ejbIterator = ASHelper.getJaxwsEjbs(unit).iterator();
- while (ejbIterator.hasNext())
- {
- final WebServiceDeclaration container = ejbIterator.next();
- final String ejbName = container.getComponentName();
- final String ejbClass = container.getComponentClassName();
-
- final Endpoint ep = this.createEndpoint(ejbClass, ejbName, dep);
- ep.setProperty(WSConstants.CONTAINER_NAME, container.getContainerName());
- }
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
- }
-
- /**
- * Creates new JAXRPC JSE deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- */
- private void newJaxrpcJseDeployment(final DeploymentUnit unit)
- {
- final ArchiveDeployment dep = this.newDeployment(unit);
- final JBossWebMetaData webMetaData = this.getAndPropagateAttachment(JBossWebMetaData.class, unit, dep);
- final WebservicesMetaData wsMetaData = this.getAndPropagateAttachment(WebservicesMetaData.class, unit, dep);
-
- for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
- {
- for (PortComponentMetaData pcmd : wsd.getPortComponents())
- {
- final String servletName = pcmd.getServletLink();
- final ServletMetaData servletMD = ASHelper.getServletForName(webMetaData, servletName);
- final String servletClass = ASHelper.getEndpointName(servletMD);
-
- this.createEndpoint(servletClass, servletName, dep);
- }
- }
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
- }
-
- /**
- * Creates new JAXWS JSE deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- */
- private void newJaxwsJseDeployment(final DeploymentUnit unit)
- {
- final ArchiveDeployment dep = this.newDeployment(unit);
- this.getAndPropagateAttachment(JBossWebMetaData.class, unit, dep);
-
- final List<ServletMetaData> servlets = ASHelper.getJaxwsServlets(unit);
- for (ServletMetaData servlet : servlets)
- {
- final String servletName = servlet.getName();
- final String servletClass = ASHelper.getEndpointName(servlet);
-
- this.createEndpoint(servletClass, servletName, dep);
- }
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
- }
-
- /**
- * Creates new Web Service deployment.
- *
- * @param unit deployment unit
- * @return archive deployment
- */
- private ArchiveDeployment newDeployment(final DeploymentUnit unit)
- {
- final ArchiveDeployment dep = this.newDeployment(unit.getSimpleName(), unit.getClassLoader());
-
- if (unit instanceof VFSDeploymentUnit)
- {
- final VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
- final List<VirtualFile> virtualFiles = vfsUnit.getMetaDataFiles(WSDeploymentDeployer.WS_FILE_FILTER);
- final Set<UnifiedVirtualFile> uVirtualFiles = new HashSet<UnifiedVirtualFile>();
- for (VirtualFile vf : virtualFiles)
- {
- // Adding the roots of the virtual files.
- try
- {
- uVirtualFiles.add(new VirtualFileAdaptor(vf.getVFS().getRoot()));
- }
- catch (IOException ioe)
- {
- throw new WSFDeploymentException(ioe);
- }
- }
- dep.setMetadataFiles(new LinkedList<UnifiedVirtualFile>(uVirtualFiles));
- }
-
- if (unit.getParent() != null)
- {
- final String parentDeploymentName = unit.getParent().getSimpleName();
- final ClassLoader parentClassLoader = unit.getParent().getClassLoader();
-
- final ArchiveDeployment parentDep = this.newDeployment(parentDeploymentName, parentClassLoader);
- dep.setParent(parentDep);
- }
-
- dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot()));
- dep.setRuntimeClassLoader(unit.getClassLoader());
- final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
- dep.setType(deploymentType);
-
- return dep;
- }
-
- /**
- * Creates new archive deployment.
- *
- * @param name deployment name
- * @param loader deployment loader
- * @return new archive deployment
- */
- private ArchiveDeployment newDeployment(final String name, final ClassLoader loader)
- {
- return (ArchiveDeployment)this.deploymentModelFactory.newDeployment(name, loader);
- }
-
- /**
- * Creates new Web Service endpoint.
- *
- * @param endpointClass endpoint class name
- * @param endpointName endpoint name
- * @param dep deployment
- * @return WS endpoint
- */
- private Endpoint createEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
- {
- if (endpointName == null)
- {
- throw new NullPointerException("Null endpoint name");
- }
-
- if (endpointClass == null)
- {
- throw new NullPointerException("Null endpoint class");
- }
-
- final Endpoint endpoint = this.deploymentModelFactory.newEndpoint(endpointClass);
- endpoint.setShortName(endpointName);
- dep.getService().addEndpoint(endpoint);
-
- return endpoint;
- }
-
- /**
- * Gets specified attachment from deployment unit.
- * Checks it's not null and then propagates it to <b>dep</b>
- * attachments. Finally it returns attachment value.
- *
- * @param <A> class type
- * @param attachment attachment
- * @param unit deployment unit
- * @param dep deployment
- * @return attachment value if found in unit
- */
- private <A> A getAndPropagateAttachment(final Class<A> attachment, final DeploymentUnit unit, final Deployment dep)
- {
- final A attachmentValue = ASHelper.getOptionalAttachment(unit, attachment);
-
- if (attachmentValue != null)
- {
- dep.addAttachment(attachment, attachmentValue);
- return attachmentValue;
- }
-
- throw new IllegalStateException("Deployment unit does not contain " + attachment);
- }
-
}
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-08-12 10:29:29 UTC (rev 10523)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-08-12 12:51:45 UTC (rev 10524)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.webservices.integration.deployers;
-
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilterWithAttributes;
-import org.jboss.virtual.VisitorAttributes;
-
-/**
- * WS file filter for files with the '.wsdl', or '.xsd' or '.xml' suffix.
- *
- * @author <a href="mailto:dbevenius@jboss.com">Daniel Bevenius</a>
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
-{
-
- /** The tree walking attributes. */
- private VisitorAttributes attributes;
-
- /**
- * Constructor.
- */
- public WSVirtualFileFilter()
- {
- this(VisitorAttributes.RECURSE_LEAVES_ONLY);
- }
-
- /**
- * Constructor.
- *
- * @param attributes visit attributes
- */
- public WSVirtualFileFilter(final VisitorAttributes attributes)
- {
- this.attributes = attributes;
- }
-
- /**
- * Gets VisitorAttributes for this instance.
- *
- * @return visitor attributes
- */
- public VisitorAttributes getAttributes()
- {
- return this.attributes;
- }
-
- /**
- * Accepts files that end with '.wsdl' or '.xsd' or '.xml'.
- *
- * @param file to analyze
- * @return true if expected file extension, false otherwise
- */
- public boolean accepts(final VirtualFile file)
- {
- if (file == null)
- {
- return false;
- }
-
- final String fileName = file.getName().toLowerCase();
- final boolean hasWsdlSuffix = fileName.endsWith(".wsdl");
- final boolean hasXsdSuffix = fileName.endsWith(".xsd");
- final boolean hasXmlSuffix = fileName.endsWith(".xml");
-
- return hasWsdlSuffix || hasXsdSuffix || hasXmlSuffix;
- }
-
-}
14 years, 10 months
JBossWS SVN: r10523 - in container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration: invocation and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-12 06:29:29 -0400 (Wed, 12 Aug 2009)
New Revision: 10523
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
Log:
[JBWS-2320] refactoring + javadoc
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2009-08-12 08:18:41 UTC (rev 10522)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2009-08-12 10:29:29 UTC (rev 10523)
@@ -50,6 +50,9 @@
/**
* Constructor.
+ *
+ * @param unit deployment unit
+ * @param delegate EJB reference resolver
*/
public EJBBeanReferenceResolver(final DeploymentUnit unit, final EjbReferenceResolver delegate)
{
@@ -68,30 +71,36 @@
this.delegate = delegate;
}
- /* (non-Javadoc)
+ /**
* @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveField(java.lang.reflect.Field)
+ *
+ * @param field to be resolved
+ * @return JNDI name of referenced EJB object
*/
@Override
protected String resolveField(final Field field)
{
final EJB ejbAnnotation = field.getAnnotation(EJB.class);
final Class<?> type = field.getType();
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
+ final EjbReference reference = this.getEjbReference(ejbAnnotation, type);
- return this.delegate.resolveEjb(unit, reference);
+ return this.delegate.resolveEjb(this.unit, reference);
}
- /* (non-Javadoc)
+ /**
* @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method)
+ *
+ * @param method to be resolved
+ * @return JNDI name of referenced EJB object
*/
@Override
protected String resolveMethod(final Method method)
{
final EJB ejbAnnotation = method.getAnnotation(EJB.class);
final Class<?> type = method.getParameterTypes()[0];
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
+ final EjbReference reference = this.getEjbReference(ejbAnnotation, type);
- return this.delegate.resolveEjb(unit, reference);
+ return this.delegate.resolveEjb(this.unit, reference);
}
/**
@@ -101,7 +110,7 @@
* @param type fall back type
* @return ejb reference instance
*/
- private EjbReference getEjbReference(EJB ejbAnnotation, Class<?> type)
+ private EjbReference getEjbReference(final EJB ejbAnnotation, final Class<?> type)
{
String beanInterface = ejbAnnotation.beanInterface().getName();
if (java.lang.Object.class.getName().equals(beanInterface))
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2009-08-12 08:18:41 UTC (rev 10522)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2009-08-12 10:29:29 UTC (rev 10523)
@@ -24,7 +24,6 @@
import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -32,10 +31,8 @@
import javax.annotation.Resource;
import javax.ejb.EJB;
-import javax.jws.WebService;
import javax.naming.Context;
import javax.naming.NamingException;
-import javax.xml.ws.WebServiceProvider;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
@@ -65,55 +62,124 @@
public final class InjectionMetaDataDeploymentAspect extends DeploymentAspect
{
- private static final ReferenceResolver RESOURCE_REFERENCE_RESOLVER = new ResourceReferenceResolver();
+ /** EJB 3 JNDI prefix. */
private static final String EJB3_JNDI_PREFIX = "java:env/";
+
+ /** Resolver handling @Resource injections. */
+ private static final ReferenceResolver RESOURCE_RESOLVER = new ResourceReferenceResolver();
+
+ /** EJB 3 reference resolver. */
private EjbReferenceResolver ejbReferenceResolver;
+ /**
+ * Constructor.
+ */
+ public InjectionMetaDataDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * Sets ejb reference resolver. This method is invoked by MC.
+ *
+ * @param resolver ejb reference resolver
+ */
+ public void setEjbReferenceResolver(final EjbReferenceResolver resolver)
+ {
+ this.ejbReferenceResolver = resolver;
+ }
+
+ /**
+ * Gets ejb reference resolver.
+ *
+ * @return ejb reference resolver
+ */
+ public EjbReferenceResolver getEjbReferenceResolver()
+ {
+ if (this.ejbReferenceResolver == null)
+ {
+ throw new IllegalStateException("No EjbReferenceResolver set by MC");
+ }
+
+ return this.ejbReferenceResolver;
+ }
+
+ /**
+ * Builds injection meta data for all endpoints in deployment.
+ *
+ * @param dep webservice deployment
+ */
@Override
- public void start(Deployment dep)
+ public void start(final Deployment dep)
{
- super.start(dep);
+ final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
+ final JBossWebMetaData jbossWebMD = WSHelper.getRequiredAttachment(dep, JBossWebMetaData.class);
+ final Map<Class<? extends Annotation>, ReferenceResolver> resolvers = this.getResolvers(unit);
- DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
- JBossWebMetaData webMD = WSHelper.getRequiredAttachment(dep, JBossWebMetaData.class);
+ if (WSHelper.isJaxwsJseDeployment(dep))
+ {
+ final EnvironmentEntriesMetaData envEntriesMD = jbossWebMD.getEnvironmentEntries();
- List<InjectionMetaData> injectionMD = new LinkedList<InjectionMetaData>();
- Map<Class<? extends Annotation>, ReferenceResolver> resolvers = createResolvers(unit);
+ // iterate through all POJO endpoints
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ // build POJO injections meta data
+ final InjectionsMetaData injectionsMD = this.buildInjectionsMetaData(envEntriesMD, resolvers, null);
- try
+ // associate injections meta data with POJO endpoint
+ endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
+ }
+ }
+ else if (WSHelper.isJaxwsEjbDeployment(dep))
{
+ final WebServiceDeployment webServiceDeployment = ASHelper.getRequiredAttachment(unit, WebServiceDeployment.class);
- if (WSHelper.isJaxwsJseDeployment(dep))
+ // iterate through all EJB3 endpoints
+ for (final WebServiceDeclaration container : webServiceDeployment.getServiceEndpoints())
{
- injectionMD.addAll(buildInjectionMetaData(webMD.getEnvironmentEntries()));
- for (Endpoint endpoint : dep.getService().getEndpoints())
+ if (ASHelper.isWebServiceBean(container))
{
- InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, resolvers, null);
+ final String ejbName = container.getComponentName();
+
+ // build EJB 3 injections meta data
+ final EnvironmentEntriesMetaData ejbEnvEntries = this.getEnvironmentEntries(ejbName, unit);
+ final Context jndiContext = this.getJndiContext(container);
+ final InjectionsMetaData injectionsMD = this.buildInjectionsMetaData(ejbEnvEntries, resolvers, jndiContext);
+
+ // associate injections meta data with EJB 3 endpoint
+ final Endpoint endpoint = dep.getService().getEndpointByName(ejbName);
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
}
}
- else if (WSHelper.isJaxwsEjbDeployment(dep))
- {
- WebServiceDeployment webServiceDeployment = ASHelper.getRequiredAttachment(unit, WebServiceDeployment.class);
- JBossMetaData jbossMD = ASHelper.getRequiredAttachment(unit, JBossMetaData.class);
- JBossEnterpriseBeansMetaData jebMDs = jbossMD.getEnterpriseBeans();
+ }
+ }
+
+ /**
+ * Returns environment entries meta data associated with specified EJB 3 bean.
+ *
+ * @param ejbName EJB 3 bean to lookup environment entries for
+ * @param unit deployment unit
+ * @return environment entries meta data
+ */
+ private EnvironmentEntriesMetaData getEnvironmentEntries(final String ejbName, final DeploymentUnit unit)
+ {
+ final JBossMetaData jbossMD = ASHelper.getRequiredAttachment(unit, JBossMetaData.class);
+ final JBossEnterpriseBeansMetaData enterpriseBeansMDs = jbossMD.getEnterpriseBeans();
+
+ return enterpriseBeansMDs.get(ejbName).getEnvironmentEntries();
+ }
- Iterator<WebServiceDeclaration> it = webServiceDeployment.getServiceEndpoints().iterator();
- while (it.hasNext())
- {
- WebServiceDeclaration container = it.next();
- if (isWebServiceBean(container))
- {
- final Context ctx = (Context)container.getContext().lookup(EJB3_JNDI_PREFIX);
- String ejbName = container.getComponentName();
- EnvironmentEntriesMetaData ejbEnvEntries = jebMDs.get(ejbName).getEnvironmentEntries();
- injectionMD.addAll(buildInjectionMetaData(ejbEnvEntries));
- Endpoint endpoint = dep.getService().getEndpointByName(ejbName);
- InjectionsMetaData injectionsMD = new InjectionsMetaData(injectionMD, resolvers, ctx);
- endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
- }
- }
- }
+ /**
+ * Returns JNDI context associated with EJB 3 container.
+ *
+ * @param container EJB 3 container
+ * @return JNDI context
+ */
+ private Context getJndiContext(final WebServiceDeclaration container)
+ {
+ try
+ {
+ return (Context)container.getContext().lookup(InjectionMetaDataDeploymentAspect.EJB3_JNDI_PREFIX);
}
catch (NamingException ne)
{
@@ -121,66 +187,84 @@
}
}
- @Override
- public void stop(Deployment dep)
- {
- dep.getService().removeAttachment(InjectionMetaData.class);
-
- super.stop(dep);
- }
-
/**
- * Builds reference resolvers container.
+ * Returns reference resolvers container.
*
* @param unit deployment unit
* @return reference resolvers
*/
- private Map<Class<? extends Annotation>, ReferenceResolver> createResolvers(DeploymentUnit unit)
+ private Map<Class<? extends Annotation>, ReferenceResolver> getResolvers(final DeploymentUnit unit)
{
final Map<Class<? extends Annotation>, ReferenceResolver> resolvers = new HashMap<Class<? extends Annotation>, ReferenceResolver>();
- resolvers.put(Resource.class, RESOURCE_REFERENCE_RESOLVER);
- resolvers.put(EJB.class, new EJBBeanReferenceResolver(unit, getEjbReferenceResolver()));
+
+ resolvers.put(Resource.class, InjectionMetaDataDeploymentAspect.RESOURCE_RESOLVER);
+ resolvers.put(EJB.class, new EJBBeanReferenceResolver(unit, this.getEjbReferenceResolver()));
+
return resolvers;
}
/**
- * Builds JBossWS specific injection metadata from JBoss metadata.
+ * Builds JBossWS specific injections meta data.
+ *
+ * @param envEntriesMD environment entries meta data
+ * @param resolvers known annotation resolvers
+ * @param jndiContext JNDI context to be propagated
+ * @return injections meta data
+ */
+ private InjectionsMetaData buildInjectionsMetaData(final EnvironmentEntriesMetaData envEntriesMD,
+ final Map<Class<? extends Annotation>, ReferenceResolver> resolvers, final Context jndiContext)
+ {
+ final List<InjectionMetaData> injectionMD = new LinkedList<InjectionMetaData>();
+ injectionMD.addAll(this.buildInjectionMetaData(envEntriesMD));
+
+ return new InjectionsMetaData(injectionMD, resolvers, jndiContext);
+ }
+
+ /**
+ * Builds JBossWS specific injection meta data.
*
- * @param envEntries environment entries
- * @return JBossWS specific injection metadata
+ * @param envEntriesMD environment entries meta data
+ * @return injection meta data
*/
- private List<InjectionMetaData> buildInjectionMetaData(EnvironmentEntriesMetaData envEntries)
+ private List<InjectionMetaData> buildInjectionMetaData(final EnvironmentEntriesMetaData envEntriesMD)
{
- if ((envEntries == null) || (envEntries.size() == 0))
+ if ((envEntriesMD == null) || (envEntriesMD.size() == 0))
{
return Collections.emptyList();
}
- EnvironmentEntryMetaData eeMD = null;
- LinkedList<InjectionMetaData> retVal = new LinkedList<InjectionMetaData>();
- String envEntryName = null;
- String envEntryValue = null;
- String targetClass = null;
- String targetName = null;
- String valueClass = null;
+ final LinkedList<InjectionMetaData> retVal = new LinkedList<InjectionMetaData>();
- for (Iterator<EnvironmentEntryMetaData> i = envEntries.iterator(); i.hasNext();)
+ Set<ResourceInjectionTargetMetaData> injectionTargets;
+ String envEntryName;
+ String envEntryValue;
+ String targetClass;
+ String targetName;
+ String envEntryValueClass;
+ boolean hasInjectionTargets;
+
+ // iterate through defined environment entries
+ for (final EnvironmentEntryMetaData envEntryMD : envEntriesMD)
{
- eeMD = i.next();
- envEntryName = eeMD.getEnvEntryName();
- envEntryValue = eeMD.getValue();
- valueClass = eeMD.getType();
+ injectionTargets = envEntryMD.getInjectionTargets();
+ hasInjectionTargets = (injectionTargets != null) && (injectionTargets.size() > 0);
- Set<ResourceInjectionTargetMetaData> injectionTargets = eeMD.getInjectionTargets();
- if ((injectionTargets != null) && (injectionTargets.size() > 0))
+ if (hasInjectionTargets)
{
- for (Iterator<ResourceInjectionTargetMetaData> j = injectionTargets.iterator(); j.hasNext();)
+ // prepare env entry meta data
+ envEntryName = envEntryMD.getEnvEntryName();
+ envEntryValue = envEntryMD.getValue();
+ envEntryValueClass = envEntryMD.getType();
+
+ // env entry can specify multiple injection targets
+ for (final ResourceInjectionTargetMetaData resourceInjectionTargetMD : injectionTargets)
{
- ResourceInjectionTargetMetaData ritMD = j.next();
- targetClass = ritMD.getInjectionTargetClass();
- targetName = ritMD.getInjectionTargetName();
- InjectionMetaData injectionMD = new InjectionMetaData(targetClass, targetName, valueClass, envEntryName, envEntryValue != null);
- retVal.add(injectionMD);
+ // prepare injection target meta data
+ targetClass = resourceInjectionTargetMD.getInjectionTargetClass();
+ targetName = resourceInjectionTargetMD.getInjectionTargetName();
+
+ // build injection meta data for injection target
+ retVal.add(new InjectionMetaData(targetClass, targetName, envEntryValueClass, envEntryName, envEntryValue != null));
}
}
}
@@ -188,43 +272,4 @@
return retVal;
}
- /**
- * Returns true if EJB represents webservice endpoint, false otherwise.
- *
- * @param container to analyze
- * @return true if webservice endpoint, false otherwise
- */
- private boolean isWebServiceBean(WebServiceDeclaration container)
- {
- boolean isWebService = container.getAnnotation(WebService.class) != null;
- boolean isWebServiceProvider = container.getAnnotation(WebServiceProvider.class) != null;
-
- return isWebService || isWebServiceProvider;
- }
-
- /**
- * Sets ejb reference resolver. This method is invoked by MC.
- *
- * @param resolver ejb reference resolver
- */
- public void setEjbReferenceResolver(final EjbReferenceResolver resolver)
- {
- this.ejbReferenceResolver = resolver;
- }
-
- /**
- * Gets ejb reference resolver.
- *
- * @return ejb reference resolver
- */
- public EjbReferenceResolver getEjbReferenceResolver()
- {
- if (this.ejbReferenceResolver == null)
- {
- throw new IllegalStateException("No EjbReferenceResolver set by MC");
- }
-
- return this.ejbReferenceResolver;
- }
-
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-08-12 08:18:41 UTC (rev 10522)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-08-12 10:29:29 UTC (rev 10523)
@@ -149,8 +149,8 @@
{
// prepare for invocation
final org.jboss.invocation.Invocation jbossInvocation = this.getMBeanInvocation(wsInvocation);
- final String[] signature = {org.jboss.invocation.Invocation.class.getName()};
- final Object[] args = new Object[] {jbossInvocation};
+ final String[] signature = { org.jboss.invocation.Invocation.class.getName() };
+ final Object[] args = new Object[] { jbossInvocation };
// invoke method
final Object retObj = this.server.invoke(ejb21Name, "invoke", args, signature);
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-12 08:18:41 UTC (rev 10522)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-12 10:29:29 UTC (rev 10523)
@@ -64,7 +64,7 @@
((ServiceLifecycle)targetBean).init(sepContext);
}
}
-
+
/**
* Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
* method on target bean if this bean implements
14 years, 10 months
JBossWS SVN: r10522 - stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-12 04:18:41 -0400 (Wed, 12 Aug 2009)
New Revision: 10522
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
Log:
[JBWS-2720] rollback
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-08-12 08:14:28 UTC (rev 10521)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EndpointServlet.java 2009-08-12 08:18:41 UTC (rev 10522)
@@ -32,7 +32,6 @@
import org.jboss.wsf.common.servlet.AbstractEndpointServlet;
import javax.servlet.ServletConfig;
-import javax.xml.rpc.server.ServiceLifecycle;
/**
* A Native endpoint servlet that is installed for every web service endpoint
@@ -86,14 +85,7 @@
try
{
final Object targetBean = holder.getObject();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
InjectionHelper.callPreDestroyMethod(targetBean);
- if (isJaxrpcLifecycleBean)
- {
- ((ServiceLifecycle)targetBean).destroy();
- }
-
}
catch (Exception exception)
{
14 years, 10 months
JBossWS SVN: r10521 - in container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration: security and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-12 04:14:28 -0400 (Wed, 12 Aug 2009)
New Revision: 10521
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java
Log:
[JBWS-2720] rollback + removing obsolete security code
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-11 17:56:42 UTC (rev 10520)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-08-12 08:14:28 UTC (rev 10521)
@@ -24,8 +24,6 @@
import javax.xml.rpc.server.ServiceLifecycle;
import javax.xml.rpc.server.ServletEndpointContext;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
@@ -48,14 +46,13 @@
/**
* Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
- * method on target bean and registers it for predestroy phase if
- * target bean implements {@link javax.xml.rpc.server.ServiceLifecycle} interface.
+ * method on target bean if this bean implements
+ * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
*
- * @param endpoint used for predestroy phase registration process
* @param invocation current invocation
* @throws Exception if any error occurs
*/
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
+ protected void onBeforeInvocation(final Invocation invocation) throws Exception
{
final InvocationContext invocationContext = invocation.getInvocationContext();
final Object targetBean = invocationContext.getTargetBean();
@@ -65,8 +62,27 @@
{
final ServletEndpointContext sepContext = invocationContext.getAttachment(ServletEndpointContext.class);
((ServiceLifecycle)targetBean).init(sepContext);
- endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
}
+
+ /**
+ * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
+ * method on target bean if this bean implements
+ * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
+ *
+ * @param invocation current invocation
+ * @throws Exception if any error occurs
+ */
+ protected void onAfterInvocation(final Invocation invocation) throws Exception
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+ final Object targetBean = invocationContext.getTargetBean();
+ final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
+ if (isJaxrpcLifecycleBean)
+ {
+ ((ServiceLifecycle)targetBean).destroy();
+ }
+ }
+
}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java 2009-08-11 17:56:42 UTC (rev 10520)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java 2009-08-12 08:14:28 UTC (rev 10521)
@@ -56,16 +56,7 @@
*/
public Principal getPrincipal()
{
- final Principal principal = SecurityAssociation.getPrincipal();
-
- if (principal != null)
- {
- return principal;
- }
- else
- {
- return AccessController.doPrivileged(new PrincipalPrivilegedAction());
- }
+ return SecurityAssociation.getPrincipal();
}
/**
@@ -85,16 +76,7 @@
*/
public Object getCredential()
{
- final Object credential = SecurityAssociation.getCredential();
-
- if (credential != null)
- {
- return credential;
- }
- else
- {
- return AccessController.doPrivileged(new CredentialPrivilegedAction());
- }
+ return SecurityAssociation.getCredential();
}
/**
@@ -133,70 +115,4 @@
});
}
- /**
- * Returns user principal from security context if available.
- */
- private static final class PrincipalPrivilegedAction implements PrivilegedAction<Principal>
- {
-
- /**
- * Constructor.
- */
- private PrincipalPrivilegedAction()
- {
- super();
- }
-
- /**
- * Execute this action.
- *
- * @return user principal if available or null.
- */
- public Principal run()
- {
- final SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
-
- if (securityContext != null)
- {
- return securityContext.getUtil().getUserPrincipal();
- }
-
- return null;
- }
-
- }
-
- /**
- * Returns user credential from security context if available.
- */
- private static final class CredentialPrivilegedAction implements PrivilegedAction<Object>
- {
-
- /**
- * Constructor.
- */
- private CredentialPrivilegedAction()
- {
- super();
- }
-
- /**
- * Execute this action.
- *
- * @return user credential if available or null.
- */
- public Object run()
- {
- final SecurityContext securityContext = SecurityContextAssociation.getSecurityContext();
-
- if (securityContext != null)
- {
- return securityContext.getUtil().getCredential();
- }
-
- return null;
- }
-
- }
-
}
14 years, 10 months
JBossWS SVN: r10520 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP/src: main/java/org/jboss/ws/tools/helpers and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-08-11 13:56:42 -0400 (Tue, 11 Aug 2009)
New Revision: 10520
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
Log:
[JBPAPP-2327] JavatoWSDL Package to Namespace mapping does not support multiple packages
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -25,8 +25,10 @@
import java.io.StringWriter;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.rpc.encoding.TypeMapping;
@@ -242,11 +244,18 @@
* think about changing just the type namespace as the types are
* generated using the typenamespace.
*
- * @param pn The Map
+ * @param map The Map
*/
- public void setPackageNamespaceMap(Map<String,String> pn)
+ public void setPackageNamespaceMap(Map<String,String> map)
{
- this.packageNamespaceMap = pn;
+ //Lets convert the namespace->package map to package->namespace map
+ Set<String> keys = map.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ packageNamespaceMap.put(map.get(pkg), pkg);
+ }
}
public void setOperationMap(Map<String, List<OperationConfig>> operationMap)
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -82,7 +82,6 @@
private JavaWsdlMapping javaWsdlMapping = new JavaWsdlMapping();
private Map<QName, JavaXmlTypeMapping> mappedTypes = new HashMap<QName, JavaXmlTypeMapping>();
private Set<String> mappedPackages = new HashSet<String>();
- private Map<String,String> packageNamespaceMap = new HashMap<String,String>();
private Set<String> mappedExceptions = new HashSet<String>();
protected void processTypes()
@@ -249,7 +248,9 @@
for(FaultMetaData fmd : operation.getFaults())
{
- JavaXmlTypeMapping typeMapping = mappedTypes.get(fmd.getXmlType());
+ String ns = getNamespace(fmd.getJavaType(), fmd.getXmlType().getNamespaceURI());
+ QName newXmlType = new QName(ns, fmd.getXmlType().getLocalPart());
+ JavaXmlTypeMapping typeMapping = mappedTypes.get(newXmlType);
if (typeMapping == null)
continue;
@@ -277,7 +278,7 @@
// Add package mapping for SEI
String name = endpoint.getServiceEndpointInterface().getPackage().getName();
- String namespace = packageNamespaceMap.get(name);
+ String namespace = getNamespace(name);
if (namespace == null)
namespace = WSDLUtils.getInstance().getTypeNamespace(name);
addPackageMapping(name, namespace);
@@ -358,6 +359,7 @@
if(Holder.class.isAssignableFrom(javaType))
javaType = WSDLUtils.getInstance().getJavaTypeForHolder(javaType);
JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType, elementNames);
+ String namespace = getNamespace(javaType, xmlType.getNamespaceURI());
// Now that the schema object graph is built,
// ask JavaToXSD to provide a list of xsmodels to be plugged
// into WSDLTypes
@@ -365,20 +367,21 @@
throw new WSException("XSModel is null");
WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- WSDLUtils.addSchemaModel(wsdlTypes, xmlType.getNamespaceURI(), xsModel);
- wsdl.registerNamespaceURI(xmlType.getNamespaceURI(), null);
+ WSDLUtils.addSchemaModel(wsdlTypes, namespace, xsModel);
+ wsdl.registerNamespaceURI(namespace, null);
//Also get any custom namespaces
SchemaCreatorIntf schemaCreator = javaToXSD.getSchemaCreator();
mergeJavaWsdlMapping(schemaCreator.getJavaWsdlMapping());
- HashMap map = schemaCreator.getCustomNamespaceMap();
- Set keys = map != null ? map.keySet() : null;
+ //Register the custom generated namespaces
+ Map<String, String> nsmap = schemaCreator.getCustomNamespaceMap();
+ Set keys = nsmap != null ? nsmap.keySet() : null;
Iterator iter = (keys != null && !keys.isEmpty()) ? keys.iterator() : null;
while (iter != null && iter.hasNext())
{
- String pref = (String)iter.next();
- String ns = (String)map.get(pref);
+ String prefix = (String)iter.next();
+ String ns = nsmap.get(prefix);
if (ns != null)
wsdl.registerNamespaceURI(ns, null);
}
@@ -390,7 +393,7 @@
for (PackageMapping packageMapping : source.getPackageMappings())
{
String name = packageMapping.getPackageType();
- String namespaceURI = packageMapping.getNamespaceURI();
+ String namespaceURI = getNamespace(name, packageMapping.getNamespaceURI());
addPackageMapping(name, namespaceURI);
}
@@ -401,16 +404,22 @@
if (name == null)
name = type.getAnonymousTypeQName();
+ //override namespace from globalconfig
+ String pkgName = getJustPackageName(type.getJavaType());
+ String ns = getNamespace(pkgName, name.getNamespaceURI());
+ name = new QName(ns, name.getLocalPart(), name.getPrefix());
+
if (mappedTypes.containsKey(name))
continue;
+ addPackageMapping(pkgName, ns);
mappedTypes.put(name, type);
JavaXmlTypeMapping typeCopy = new JavaXmlTypeMapping(javaWsdlMapping);
typeCopy.setQNameScope(type.getQnameScope());
typeCopy.setAnonymousTypeQName(type.getAnonymousTypeQName());
typeCopy.setJavaType(type.getJavaType());
- typeCopy.setRootTypeQName(type.getRootTypeQName());
+ typeCopy.setRootTypeQName(name);
for (VariableMapping variable : type.getVariableMappings())
{
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -304,12 +304,12 @@
if (xmlType != null)
{
name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
}
else
{
name = WSDLUtils.getJustClassName(javaType);
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
}
// Check if it is a JAX-RPC enumeration
@@ -567,19 +567,19 @@
if (xmlType != null)
{
name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(componentType, xmlType.getNamespaceURI());
}
else
{
if (isComponentArray == false)
{
name = utils.getJustClassName(componentType.getName()) + ".Array";
- namespace = getNamespace(componentType);
+ namespace = getNamespace(componentType, null);
}
else
{
name = xst.getName() + ".Array";
- namespace = xst.getNamespace();
+ namespace = getNamespace(componentType, xst.getNamespace());
}
}
@@ -701,23 +701,42 @@
}
}
- private String getNamespace(Class javaType)
+ private String getNamespace(Class javaType, String defaultNS)
{
- if (javaType.isPrimitive())
- return Constants.NS_JBOSSWS_URI + "/primitives";
+ String retNS = defaultNS;
+ if (javaType.isPrimitive() && retNS == null)
+ {
+ retNS = Constants.NS_JBOSSWS_URI + "/primitives";
+ }
+ else
+ {
+ while (javaType.isArray())
+ {
+ javaType = javaType.getComponentType();
+ }
- Package javaPackage = javaType.getPackage();
- if (javaPackage == null)
- throw new WSException("Cannot determine namespace, Class had no package");
- String packageName = javaPackage.getName();
+ Package javaPackage = javaType.getPackage();
+ if (javaPackage != null)
+ {
+ String packageName = javaPackage.getName();
+ String ns = packageNamespaceMap.get(packageName);
+ if (ns != null)
+ {
+ retNS = ns;
+ }
+ else if (retNS == null)
+ {
+ retNS = utils.getTypeNamespace(packageName);
+ }
- String ns = packageNamespaceMap.get(packageName);
- if (ns == null)
- ns = utils.getTypeNamespace(packageName);
-
- allocatePrefix(ns);
-
- return ns;
+ allocatePrefix(retNS);
+ }
+ else if (retNS == null)
+ {
+ throw new WSException("Cannot determine namespace, Class had no package");
+ }
+ }
+ return retNS;
}
private JBossXSComplexTypeDefinition getComplexTypeForJavaException(QName xmlType, Class javaType)
@@ -731,12 +750,12 @@
String namespace;
if (xmlType != null)
{
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
name = xmlType.getLocalPart();
}
else
{
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
name = WSDLUtils.getJustClassName(javaType);
}
@@ -749,6 +768,8 @@
xsModel.addXSComplexTypeDefinition(complexType);
xsModel.addXSElementDeclaration(sutils.createGlobalXSElementDeclaration(name, complexType, namespace));
typeMapping.register(javaType, new QName(namespace, name), null, null);
+ generateExceptionParticles(namespace, javaType, types, particles);
+
registerJavaTypeMapping(new QName(namespace, name), javaType, "complexType", particles, null);
Class superClass = javaType.getSuperclass();
@@ -758,7 +779,6 @@
complexType.setBaseType(baseType);
}
- generateExceptionParticles(namespace, javaType, types, particles);
boolean found = hasConstructor(javaType, types);
boolean noarg = found && types.size() == 0;
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -288,8 +288,7 @@
if (writtenFaultMessages.contains(exceptionName))
continue;
- WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(fault.getRef());
- QName xmlName = interfaceFault.getElement();
+ QName xmlName = fault.getRef();
buffer.append("<message name='" + exceptionName + "' >");
String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
@@ -449,8 +448,7 @@
for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
{
QName element = fault.getRef();
- String faultPrefix = wsdl.getPrefix(element.getNamespaceURI());
- buffer.append("<fault message='" + faultPrefix + ":" + element.getLocalPart());
+ buffer.append("<fault message='" + prefix + ":" + element.getLocalPart());
buffer.append("' name='" + element.getLocalPart() + "'/>");
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -23,7 +23,10 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
@@ -81,6 +84,8 @@
protected abstract void processTypes();
+ protected Map<String,String> packageNamespaceMap = new HashMap<String,String>();
+
protected void processEndpoint(WSDLService service, EndpointMetaData endpoint)
{
WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(service, endpoint.getPortName());
@@ -216,7 +221,9 @@
wsdlInterface.addFault(interfaceFault);
WSDLInterfaceOperationOutfault outfault = new WSDLInterfaceOperationOutfault(interfaceOperation);
- outfault.setRef(faultName);
+ String ns = getNamespace(fault.getJavaType(), operation.getQName().getNamespaceURI());
+ QName outFaultName = new QName(ns, fault.getXmlName().getLocalPart());
+ outfault.setRef(outFaultName);
interfaceOperation.addOutfault(outfault);
WSDLBindingFault bindingFault = new WSDLBindingFault(wsdlBinding);
@@ -355,7 +362,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(returnParameter.getPartName(), returnParameter.getXmlType());
+ QName xmlType = returnParameter.getXmlType();
+ String ns = getNamespace(returnParameter.getJavaType(), xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(partName, newXmlType);
+
output.addChildPart(part);
}
addSignatureItem(interfaceOperation, returnParameter, true);
@@ -378,7 +389,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), param.getXmlType());
+ QName xmlType = param.getXmlType();
+
+ String ns = getNamespace(param.getJavaType(), xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), newXmlType);
if (param.getMode() != ParameterMode.OUT)
input.addChildPart(part);
if (twoWay && param.getMode() != ParameterMode.IN)
@@ -428,6 +443,18 @@
wsdl.registerNamespaceURI(ns, "tns");
wsdl.registerNamespaceURI(Constants.NS_SCHEMA_XSD, "xsd");
+ // Register global namespaces
+ if (packageNamespaceMap != null)
+ {
+ Set<String> keys = packageNamespaceMap.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ wsdl.registerNamespaceURI(packageNamespaceMap.get(pkg), null);
+ }
+ }
+
String soapURI = null;
String soapPrefix = null;
for (EndpointMetaData ep : service.getEndpoints())
@@ -453,4 +480,47 @@
return wsdl;
}
+
+ protected String getNamespace(String packageName, String defaultNS)
+ {
+ String retNS = defaultNS;
+ //Get it from global config if it is overriden
+ if (packageNamespaceMap != null)
+ {
+ String ns = packageNamespaceMap.get(packageName);
+ if (ns != null)
+ {
+ retNS = ns;
+ }
+ }
+ return retNS;
+ }
+
+ protected String getNamespace(String packageName)
+ {
+ return getNamespace(packageName, wsdl.getTargetNamespace());
+ }
+
+ protected String getNamespace(Class type, String defaultNS)
+ {
+ while (type.isArray())
+ {
+ type = type.getComponentType();
+ }
+ Package pkg = type.getPackage();
+ String pkgName = null;
+ if (pkg != null)
+ {
+ pkgName = pkg.getName();
+ }
+ return getNamespace(pkgName, defaultNS);
+ }
+
+ protected String getJustPackageName(String classname)
+ {
+ int index = classname.lastIndexOf(".");
+ if (index < 0)
+ index = classname.length();
+ return classname.substring(0,index);
+ }
}
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/BaseException.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jbws2018.base;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class BaseException extends Exception
+{
+ public BaseException()
+ {
+ }
+}
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/JBWS2018TestCase.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.tools.jbws2018;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * JBWS-2018 - Test the support of multiple namespace to multiple
+ * package generation of tools JavaToWSDL.
+ *
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class JBWS2018TestCase extends WSToolsTest
+{
+ public final void testMultiplePackageNameSpace() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws2018";
+ String toolsDir = "tools/jbws2018";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ semanticallyValidateWSDL(resourceDir + "/TestService.wsdl", toolsDir + "/wsdl/TestService.wsdl");
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
+ }
+}
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/Test.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jbws2018;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import org.jboss.test.ws.jbws2018.base.BaseException;
+import org.jboss.test.ws.jbws2018.exception.TestException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public interface Test extends Remote
+{
+
+ public void testException() throws TestException, RemoteException;
+ public BaseException getException() throws TestException, RemoteException;
+ public void setException(BaseException error) throws TestException, RemoteException;
+ public BaseException[] getExceptions() throws TestException, RemoteException;
+ public void setExceptions(BaseException[] errors) throws TestException, RemoteException;
+}
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/tools/jbws2018/TestException.java 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.ws.jbws2018.exception;
+
+import org.jboss.test.ws.jbws2018.base.BaseException;
+
+/**
+ * @author mageshbk(a)jboss.com
+ * @since 10 March 2008
+ */
+public class TestException extends BaseException
+{
+ public TestException()
+ {
+ }
+}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2009-08-11 14:01:52 UTC (rev 10519)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2009-08-11 17:56:42 UTC (rev 10520)
@@ -29,6 +29,10 @@
<java-type>org.jboss.test.ws.tools.jbws1231.CustomException</java-type>
<root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1231/type'>typeNS:CustomException</root-type-qname>
<qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>wrappedException</java-variable-name>
+ <xml-element-name>wrappedException</xml-element-name>
+ </variable-mapping>
</java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.tools.jbws1231.TestEndpoint_echoDataObject_ResponseStruct</java-type>
@@ -42,6 +46,9 @@
<exception-mapping>
<exception-type>org.jboss.test.ws.tools.jbws1231.CustomException</exception-type>
<wsdl-message xmlns:exMsgNS='http://org.jboss.test.ws/jbws1231'>exMsgNS:CustomException</wsdl-message>
+ <constructor-parameter-order>
+ <element-name>wrappedException</element-name>
+ </constructor-parameter-order>
</exception-mapping>
<service-interface-mapping>
<service-interface>org.jboss.test.ws.tools.jbws1231.TestService</service-interface>
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/TestService.wsdl 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws.jbws2018' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://com.other.base' xmlns:ns2='http://com.other.exception' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws.jbws2018' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://com.other.exception' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://com.other.base' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.other.exception' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.base'/>
+ <complexType name='TestException'>
+ <complexContent>
+ <extension base='ns2:BaseException'>
+ <sequence/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name='TestException' type='tns:TestException'/>
+ </schema>
+ <schema targetNamespace='http://com.other.base' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://com.other.exception' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.other.base' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <import namespace='http://com.other.exception'/>
+ <complexType name='BaseException'>
+ <sequence/>
+ </complexType>
+ <complexType name='BaseException.Array'>
+ <sequence>
+ <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='tns:BaseException'/>
+ </sequence>
+ </complexType>
+ <element name='BaseException' type='tns:BaseException'/>
+ </schema>
+ </types>
+ <message name='Test_getException' xmlns='http://schemas.xmlsoap.org/wsdl/'/>
+ <message name='Test_getExceptionResponse'>
+ <part name='result' type='ns1:BaseException'/>
+ </message>
+ <message name='TestException'>
+ <part element='ns2:TestException' name='TestException'/>
+ </message>
+ <message name='Test_getExceptions'/>
+ <message name='Test_getExceptionsResponse'>
+ <part name='result' type='ns1:BaseException.Array'/>
+ </message>
+ <message name='Test_setException'>
+ <part name='BaseException_1' type='ns1:BaseException'/>
+ </message>
+ <message name='Test_setExceptionResponse'/>
+ <message name='Test_setExceptions'>
+ <part name='arrayOfBaseException_1' type='ns1:BaseException.Array'/>
+ </message>
+ <message name='Test_setExceptionsResponse'/>
+ <message name='Test_testException'/>
+ <message name='Test_testExceptionResponse'/>
+ <portType name='Test'>
+ <operation name='getException'>
+ <input message='tns:Test_getException'/>
+ <output message='tns:Test_getExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='getExceptions'>
+ <input message='tns:Test_getExceptions'/>
+ <output message='tns:Test_getExceptionsResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='setException' parameterOrder='BaseException_1'>
+ <input message='tns:Test_setException'/>
+ <output message='tns:Test_setExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='setExceptions' parameterOrder='arrayOfBaseException_1'>
+ <input message='tns:Test_setExceptions'/>
+ <output message='tns:Test_setExceptionsResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ <operation name='testException'>
+ <input message='tns:Test_testException'/>
+ <output message='tns:Test_testExceptionResponse'/>
+ <fault message='tns:TestException' name='TestException'/>
+ </operation>
+ </portType>
+ <binding name='TestBinding' type='tns:Test'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='getExceptions'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='setException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='setExceptions'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ <operation name='testException'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws.jbws2018' use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestBinding' name='TestPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/jaxrpc-mapping.xml 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.exception</package-type>
+ <namespaceURI>http://com.other.exception</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018.base</package-type>
+ <namespaceURI>http://com.other.base</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws2018</package-type>
+ <namespaceURI>http://org.jboss.test.ws.jbws2018</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.exception.TestException</java-type>
+ <root-type-qname xmlns:typeNS='http://com.other.exception'>typeNS:TestException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws2018.base.BaseException</java-type>
+ <root-type-qname xmlns:typeNS='http://com.other.base'>typeNS:BaseException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <exception-mapping>
+ <exception-type>org.jboss.test.ws.jbws2018.exception.TestException</exception-type>
+ <wsdl-message xmlns:exMsgNS='http://org.jboss.test.ws.jbws2018'>exMsgNS:TestException</wsdl-message>
+ </exception-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws2018.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws.jbws2018'>serviceNS:TestService</wsdl-service-name>
+ <port-mapping>
+ <port-name>TestPort</port-name>
+ <java-port-name>TestPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws2018.Test</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws.jbws2018'>portTypeNS:Test</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws.jbws2018'>bindingNS:TestBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>getException</java-method-name>
+ <wsdl-operation>getException</wsdl-operation>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws2018.base.BaseException</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_getExceptionResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>testException</java-method-name>
+ <wsdl-operation>testException</wsdl-operation>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>setException</java-method-name>
+ <wsdl-operation>setException</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws2018.base.BaseException</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_setException</wsdl-message>
+ <wsdl-message-part-name>BaseException_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>getExceptions</java-method-name>
+ <wsdl-operation>getExceptions</wsdl-operation>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws2018.base.BaseException[]</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_getExceptionsResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>setExceptions</java-method-name>
+ <wsdl-operation>setExceptions</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws2018.base.BaseException[]</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbws2018'>wsdlMsgNS:Test_setExceptions</wsdl-message>
+ <wsdl-message-part-name>arrayOfBaseException_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Added: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/tools/jbws2018/wstools-config.xml 2009-08-11 17:56:42 UTC (rev 10520)
@@ -0,0 +1,16 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+ <global>
+ <package-namespace package="org.jboss.test.ws.jbws2018.base" namespace="http://com.other.base"/>
+ <package-namespace package="org.jboss.test.ws.jbws2018.exception" namespace="http://com.other.exception"/>
+ </global>
+
+ <java-wsdl>
+ <service name="TestService" style="rpc" endpoint="org.jboss.test.ws.jbws2018.Test"/>
+ <namespaces target-namespace="http://org.jboss.test.ws.jbws2018" type-namespace="http://org.jboss.test.ws.jbws2018"/>
+ <mapping file="jaxrpc-mapping.xml" />
+ <webservices ejb-link="TestEJB"/>
+ </java-wsdl>
+
+</configuration>
\ No newline at end of file
14 years, 10 months