JBossWS SVN: r14928 - in container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main: java/org/jboss/webservices/integration/deployers/deployment and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-05 04:11:20 -0400 (Mon, 05 Sep 2011)
New Revision: 14928
Removed:
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
Modified:
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-3351]:build and deploy EJB3 endpoint in a war file
Deleted: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -1,67 +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.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * This deployer initializes JBossWS deployment meta data.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WSDeploymentDeployer extends AbstractRealDeployer
-{
- /**
- * Constructor.
- */
- public WSDeploymentDeployer()
- {
- super();
-
- // inputs
- this.addInput(JBossWebMetaData.class);
- this.addInput(DeploymentType.class);
-
- // outputs
- this.addOutput(JBossWebMetaData.class);
- this.addOutput(Deployment.class);
- }
-
- /**
- * Creates new Web Service deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- * @throws DeploymentException if any error occurs
- */
- @Override
- protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
- {
- this.log.trace("Building JBoss agnostic webservices meta data model");
- WSDeploymentBuilder.getInstance().build(unit);
- }
-}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -26,9 +26,11 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webservices.integration.WebServiceDeployment;
+import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-import org.jboss.webservices.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
/**
@@ -51,8 +53,8 @@
this.addInput(WebServiceDeployment.class);
// outputs
- this.addOutput(DeploymentType.class);
this.addOutput(JBossWebMetaData.class);
+ this.addOutput(Deployment.class);
}
/**
@@ -64,25 +66,26 @@
@Override
protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
{
+
if (this.isJaxwsJseDeployment(unit))
{
this.log.debug("Detected JAXWS JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_JSE);
}
- else if (this.isJaxwsEjbDeployment(unit))
+ if (this.isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXWS EJB3 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_EJB3);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_EJB3);
}
- else if (this.isJaxrpcJseDeployment(unit))
+ if (this.isJaxrpcJseDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_JSE);
}
- else if (this.isJaxrpcEjbDeployment(unit))
+ if (this.isJaxrpcEjbDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC EJB21 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_EJB21);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_EJB21);
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -39,9 +39,9 @@
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.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -80,12 +80,26 @@
*/
public final void newDeploymentModel(final DeploymentUnit unit)
{
- final ArchiveDeployment dep = this.newDeployment(unit);
+ final ArchiveDeployment dep;
+ if (unit.getAttachment(Deployment.class) != null)
+ {
+ dep = (ArchiveDeployment) unit.getAttachment(Deployment.class);
+ }
+ else
+ {
+ try
+ {
+ dep = this.newDeployment(unit);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ dep.addAttachment(DeploymentUnit.class, unit);
+ unit.addAttachment(Deployment.class, dep);
+ }
this.build(dep, unit);
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
}
/**
@@ -104,7 +118,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep, final EndpointType endpointType)
{
if (endpointName == null)
{
@@ -119,7 +133,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newHttpEndpoint(endpointClass);
endpoint.setShortName(endpointName);
dep.getService().addEndpoint(endpoint);
-
+ endpoint.setType(endpointType);
return endpoint;
}
@@ -131,7 +145,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep, final EndpointType endpointType)
{
if (endpointName == null)
{
@@ -146,6 +160,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newJMSEndpoint(endpointClass);
endpoint.setShortName(endpointName);
dep.getService().addEndpoint(endpoint);
+ endpoint.setType(endpointType);
return endpoint;
}
@@ -193,8 +208,6 @@
dep.setRootFile(new ResourceLoaderAdapter(unit.getClassLoader()));
}
dep.setRuntimeClassLoader(unit.getClassLoader());
- final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
- dep.setType(deploymentType);
return dep;
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -25,6 +25,7 @@
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
@@ -69,7 +70,7 @@
final String ejbClass = beanMetaData.getEjbClass();
this.log.debug("EJB21 class: " + ejbClass);
- this.newHttpEndpoint(ejbClass, ejbName, dep);
+ this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXRPC_EJB21);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -26,6 +26,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -68,7 +69,7 @@
final String servletClass = ASHelper.getEndpointName(servletMD);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXRPC_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -26,6 +26,7 @@
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -64,7 +65,7 @@
final String ejbClass = container.getComponentClassName();
this.log.debug("EJB3 class: " + ejbClass);
- final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep);
+ final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXWS_EJB3);
ep.setProperty(ASHelper.CONTAINER_NAME, container.getContainerName());
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointMetaData;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
@@ -63,7 +64,8 @@
{
endpoint.setName(endpoint.getImplementor());
}
- this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep);
+ this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep, EndpointType.JAXWS_JMS);
+
}
}
}
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* Creates new JAXWS JSE deployment.
@@ -64,7 +65,7 @@
final String servletClass = ASHelper.getEndpointName(servlet);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXWS_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -25,8 +25,7 @@
import java.util.Map;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* JBossWS deployment model builder.
@@ -39,14 +38,15 @@
private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
/** Builders registry. */
- private static final Map<DeploymentType, DeploymentModelBuilder> builders = new HashMap<DeploymentType, DeploymentModelBuilder>();;
+ private static final Map<EndpointType, DeploymentModelBuilder> builders = new HashMap<EndpointType, DeploymentModelBuilder>();
static
{
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JMS, new DeploymentModelBuilderJAXWS_JMS());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
}
/**
@@ -72,13 +72,12 @@
*
* @param unit deployment unit
*/
- public void build(final DeploymentUnit unit)
+ public void build(final DeploymentUnit unit, final EndpointType endpointType)
{
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
- if (deploymentType != null)
+ if (endpointType != null)
{
- WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
+ WSDeploymentBuilder.builders.get(endpointType).newDeploymentModel(unit);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-05 08:11:20 UTC (rev 14928)
@@ -38,7 +38,7 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -74,118 +74,12 @@
*/
public static boolean isWebServiceDeployment(final DeploymentUnit unit)
{
- return ASHelper.getOptionalAttachment(unit, DeploymentType.class) != null;
+ return ASHelper.getOptionalAttachment(unit, Deployment.class) != null;
}
- /**
- * Returns true if unit contains JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC EJB deployment, false otherwise
- */
- public static boolean isJaxrpcEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
- return DeploymentType.JAXRPC_EJB21.equals(deploymentType);
- }
/**
- * Returns true if unit contains JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXRPC_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS EJB deployment, false otherwise
- */
- public static boolean isJaxwsEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_EJB3.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
- */
- public static boolean isJseDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxwsJse || isJaxrpcJse;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
- */
- public static boolean isEjbDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
-
- return isJaxwsEjb || isJaxrpcEjb;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
-
- return isJaxwsEjb || isJaxwsJse;
- }
-
- /**
- * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxrpcEjb || isJaxrpcJse;
- }
-
- /**
* Gets list of JAXWS servlets meta data.
*
* @param unit deployment unit
Modified: container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-05 08:05:23 UTC (rev 14927)
+++ container/jboss60/branches/jbossws-jboss600-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-05 08:11:20 UTC (rev 14928)
@@ -62,8 +62,6 @@
<bean name="WSTypeDeployer" class="org.jboss.webservices.integration.deployers.WSTypeDeployer"/>
- <bean name="WSDeploymentDeployer" class="org.jboss.webservices.integration.deployers.WSDeploymentDeployer"/>
-
<!-- WSDeploymentAspectDeployers factory -->
<bean name="WSAspectizedDeployersFactory" class="org.jboss.webservices.integration.deployers.WSAspectizedDeployersFactory">
<constructor>
13 years, 4 months
JBossWS SVN: r14927 - container/jboss60/branches.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-05 04:05:23 -0400 (Mon, 05 Sep 2011)
New Revision: 14927
Added:
container/jboss60/branches/jbossws-jboss600-JBWS-3343/
Log:
Create JBWS-3343 workspace
13 years, 4 months
JBossWS SVN: r14926 - in container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main: java/org/jboss/webservices/integration/deployers/deployment and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-05 04:02:03 -0400 (Mon, 05 Sep 2011)
New Revision: 14926
Modified:
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-3351]:to support build and deploy EJB3 endpoint in a war file
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -1,67 +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.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
-
-/**
- * This deployer initializes JBossWS deployment meta data.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WSDeploymentDeployer extends AbstractRealDeployer
-{
- /**
- * Constructor.
- */
- public WSDeploymentDeployer()
- {
- super();
-
- // inputs
- this.addInput(JBossWebMetaData.class);
- this.addInput(DeploymentType.class);
-
- // outputs
- this.addOutput(JBossWebMetaData.class);
- this.addOutput(Deployment.class);
- }
-
- /**
- * Creates new Web Service deployment and registers it with deployment unit.
- *
- * @param unit deployment unit
- * @throws DeploymentException if any error occurs
- */
- @Override
- protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
- {
- this.log.trace("Building JBoss agnostic webservices meta data model");
- WSDeploymentBuilder.getInstance().build(unit);
- }
-}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -26,9 +26,10 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.webservices.integration.WebServiceDeployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
/**
@@ -50,9 +51,9 @@
this.addInput(WebservicesMetaData.class);
this.addInput(WebServiceDeployment.class);
- // outputs
- this.addOutput(DeploymentType.class);
+ // outputs
this.addOutput(JBossWebMetaData.class);
+ this.addOutput(EndpointType.class);
}
/**
@@ -67,22 +68,22 @@
if (this.isJaxwsJseDeployment(unit))
{
this.log.debug("Detected JAXWS JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_JSE);
}
- else if (this.isJaxwsEjbDeployment(unit))
+ if (this.isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXWS EJB3 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXWS_EJB3);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_EJB3);
}
- else if (this.isJaxrpcJseDeployment(unit))
+ if (this.isJaxrpcJseDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC JSE deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_JSE);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_JSE);
}
- else if (this.isJaxrpcEjbDeployment(unit))
+ if (this.isJaxrpcEjbDeployment(unit) && !isJaxwsJseDeployment(unit) && !isJaxwsEjbDeployment(unit))
{
this.log.debug("Detected JAXRPC EJB21 deployment");
- unit.addAttachment(DeploymentType.class, DeploymentType.JAXRPC_EJB21);
+ WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_EJB21);
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -39,9 +39,9 @@
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.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -80,12 +80,26 @@
*/
public final void newDeploymentModel(final DeploymentUnit unit)
{
- final ArchiveDeployment dep = this.newDeployment(unit);
+ final ArchiveDeployment dep;
+ if (unit.getAttachment(Deployment.class) != null)
+ {
+ dep = (ArchiveDeployment) unit.getAttachment(Deployment.class);
+ }
+ else
+ {
+ try
+ {
+ dep = this.newDeployment(unit);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ dep.addAttachment(DeploymentUnit.class, unit);
+ unit.addAttachment(Deployment.class, dep);
+ }
this.build(dep, unit);
-
- dep.addAttachment(DeploymentUnit.class, unit);
- unit.addAttachment(Deployment.class, dep);
}
/**
@@ -104,7 +118,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep, final EndpointType endpointType)
{
if (endpointName == null)
{
@@ -118,6 +132,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newHttpEndpoint(endpointClass);
endpoint.setShortName(endpointName);
+ endpoint.setType(endpointType);
dep.getService().addEndpoint(endpoint);
return endpoint;
@@ -131,7 +146,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep)
+ protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final Deployment dep, EndpointType endpointType)
{
if (endpointName == null)
{
@@ -145,6 +160,7 @@
final Endpoint endpoint = this.deploymentModelFactory.newJMSEndpoint(endpointClass);
endpoint.setShortName(endpointName);
+ endpoint.setType(endpointType);
dep.getService().addEndpoint(endpoint);
return endpoint;
@@ -193,9 +209,6 @@
dep.setRootFile(new ResourceLoaderAdapter(unit.getClassLoader()));
}
dep.setRuntimeClassLoader(unit.getClassLoader());
- final DeploymentType deploymentType = ASHelper.getRequiredAttachment(unit, DeploymentType.class);
- dep.setType(deploymentType);
-
return dep;
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -25,6 +25,7 @@
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
@@ -69,7 +70,7 @@
final String ejbClass = beanMetaData.getEjbClass();
this.log.debug("EJB21 class: " + ejbClass);
- this.newHttpEndpoint(ejbClass, ejbName, dep);
+ this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXRPC_EJB21);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -26,6 +26,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -68,7 +69,7 @@
final String servletClass = ASHelper.getEndpointName(servletMD);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXRPC_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -26,6 +26,7 @@
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -64,7 +65,7 @@
final String ejbClass = container.getComponentClassName();
this.log.debug("EJB3 class: " + ejbClass);
- final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep);
+ final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXWS_EJB3);
ep.setProperty(ASHelper.CONTAINER_NAME, container.getContainerName());
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointMetaData;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
@@ -63,7 +64,7 @@
{
endpoint.setName(endpoint.getImplementor());
}
- this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep);
+ this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep, EndpointType.JAXWS_JMS);
}
}
}
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* Creates new JAXWS JSE deployment.
@@ -64,7 +65,7 @@
final String servletClass = ASHelper.getEndpointName(servlet);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep);
+ this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXWS_JSE);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -26,7 +26,7 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
/**
* JBossWS deployment model builder.
@@ -39,14 +39,15 @@
private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
/** Builders registry. */
- private static final Map<DeploymentType, DeploymentModelBuilder> builders = new HashMap<DeploymentType, DeploymentModelBuilder>();;
+ private static final Map<EndpointType, DeploymentModelBuilder> builders = new HashMap<EndpointType, DeploymentModelBuilder>();;
static
{
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
- WSDeploymentBuilder.builders.put(DeploymentType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_JSE, new DeploymentModelBuilderJAXWS_JMS());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_JSE, new DeploymentModelBuilderJAXRPC_JSE());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXWS_EJB3, new DeploymentModelBuilderJAXWS_EJB3());
+ WSDeploymentBuilder.builders.put(EndpointType.JAXRPC_EJB21, new DeploymentModelBuilderJAXRPC_EJB21());
}
/**
@@ -72,13 +73,11 @@
*
* @param unit deployment unit
*/
- public void build(final DeploymentUnit unit)
+ public void build(final DeploymentUnit unit, final EndpointType endpointType)
{
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- if (deploymentType != null)
+ if (endpointType != null)
{
- WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
+ WSDeploymentBuilder.builders.get(endpointType).newDeploymentModel(unit);
}
}
}
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-05 08:02:03 UTC (rev 14926)
@@ -38,7 +38,7 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -74,118 +74,10 @@
*/
public static boolean isWebServiceDeployment(final DeploymentUnit unit)
{
- return ASHelper.getOptionalAttachment(unit, DeploymentType.class) != null;
+ return ASHelper.getOptionalAttachment(unit, Deployment.class) != null;
}
/**
- * Returns true if unit contains JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC EJB deployment, false otherwise
- */
- public static boolean isJaxrpcEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXRPC_EJB21.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXRPC_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS EJB deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS EJB deployment, false otherwise
- */
- public static boolean isJaxwsEjbDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_EJB3.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsJseDeployment(final DeploymentUnit unit)
- {
- final DeploymentType deploymentType = ASHelper.getOptionalAttachment(unit, DeploymentType.class);
-
- return DeploymentType.JAXWS_JSE.equals(deploymentType);
- }
-
- /**
- * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
- */
- public static boolean isJseDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxwsJse || isJaxrpcJse;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
- */
- public static boolean isEjbDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
-
- return isJaxwsEjb || isJaxrpcEjb;
- }
-
- /**
- * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
- */
- public static boolean isJaxwsDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxwsEjb = ASHelper.isJaxwsEjbDeployment(unit);
- final boolean isJaxwsJse = ASHelper.isJaxwsJseDeployment(unit);
-
- return isJaxwsEjb || isJaxwsJse;
- }
-
- /**
- * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
- *
- * @param unit deployment unit
- * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
- */
- public static boolean isJaxrpcDeployment(final DeploymentUnit unit)
- {
- final boolean isJaxrpcEjb = ASHelper.isJaxrpcEjbDeployment(unit);
- final boolean isJaxrpcJse = ASHelper.isJaxrpcJseDeployment(unit);
-
- return isJaxrpcEjb || isJaxrpcJse;
- }
-
- /**
* Gets list of JAXWS servlets meta data.
*
* @param unit deployment unit
Modified: container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-05 07:55:24 UTC (rev 14925)
+++ container/jboss60/branches/jbossws-jboss610-JBWS-3343/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-05 08:02:03 UTC (rev 14926)
@@ -62,8 +62,6 @@
<bean name="WSTypeDeployer" class="org.jboss.webservices.integration.deployers.WSTypeDeployer"/>
- <bean name="WSDeploymentDeployer" class="org.jboss.webservices.integration.deployers.WSDeploymentDeployer"/>
-
<!-- WSDeploymentAspectDeployers factory -->
<bean name="WSAspectizedDeployersFactory" class="org.jboss.webservices.integration.deployers.WSAspectizedDeployersFactory">
<constructor>
13 years, 4 months
JBossWS SVN: r14925 - container/jboss60/branches.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-05 03:55:24 -0400 (Mon, 05 Sep 2011)
New Revision: 14925
Added:
container/jboss60/branches/jbossws-jboss610-JBWS-3343/
Log:
Create workspace for JBWS-3343
13 years, 4 months
JBossWS SVN: r14924 - in common/branches/JBWS-3343/src/main/java/org/jboss/ws/common: integration and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-02 01:42:04 -0400 (Fri, 02 Sep 2011)
New Revision: 14924
Modified:
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
Log:
[JBWS-3349]:Remove checkers which relies on DeplymentType in stack agnostic DAs
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -46,10 +46,8 @@
private static final ResourceBundle bundle = BundleUtils.getBundle(ContextRootDeploymentAspect.class);
@Override
public void start(Deployment dep)
- {
- //TODO: set contextRoot to each endpoint
- String contextRoot = null;
- //dep.getService().getContextRoot();
+ {
+ String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
{
contextRoot = getExplicitContextRoot(dep);
@@ -60,7 +58,7 @@
if (contextRoot.startsWith("/") == false)
contextRoot = "/" + contextRoot;
- // dep.getService().setContextRoot(contextRoot);
+ dep.getService().setContextRoot(contextRoot);
}
}
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -39,8 +39,6 @@
private String simpleName;
// A deployment has one service
private Service service;
- // The type of this deployment
- private DeploymentType type;
// The state for this deployment
private DeploymentState state;
// The deployment class loader
@@ -107,13 +105,4 @@
this.state = deploymentState;
}
- public DeploymentType getType()
- {
- return type;
- }
-
- public void setType(DeploymentType deploymentType)
- {
- this.type = deploymentType;
- }
}
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -22,6 +22,7 @@
package org.jboss.ws.common.deployment;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -43,6 +44,7 @@
{
private Deployment dep;
private List<Endpoint> endpoints = new LinkedList<Endpoint>();
+ private List<EndpointType> endpointTypes = new LinkedList<EndpointType>();
private String contextRoot;
private List<String> virtualHosts;
@@ -71,6 +73,16 @@
return endpoints;
}
+ public void addEndpointType(EndpointType endpointType)
+ {
+ endpointTypes.add(endpointType);
+ }
+
+ public List<EndpointType> getEndpointTypes()
+ {
+ return endpointTypes;
+ }
+
public List<Endpoint> getEndpoints(EndpointTypeFilter filter)
{
List<Endpoint> result = new LinkedList<Endpoint>();
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -28,7 +28,6 @@
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
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.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -46,7 +45,8 @@
@Override
public void start(Deployment dep)
{
- dep.setType(DeploymentType.JAXWS_JSE);
+ //TODO:Review why this set JAXWS_JSE type
+ //dep.setType(DeploymentType.JAXWS_JSE);
if (dep instanceof ArchiveDeployment)
{
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -33,8 +33,8 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -57,9 +57,7 @@
@Override
public void start(Deployment dep)
{
- //TODO:set contextRoot to eache endpoint
- //String contextRoot = dep.getService().getContextRoot();
- String contextRoot = "";
+ String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_CONTEXT_ROOT"));
@@ -123,7 +121,7 @@
protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)
{
String transportGuarantee = null;
- if (DeploymentType.JAXWS_JSE == dep.getType())
+ if (EndpointType.JAXWS_JSE == ep.getType())
{
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
if (webMetaData != null)
@@ -154,7 +152,7 @@
}
}
}
- else if (DeploymentType.JAXWS_EJB3 == dep.getType())
+ else if (EndpointType.JAXWS_EJB3 == ep.getType())
{
//TODO Unify annotation scans
Class implClass = ep.getTargetBeanClass();
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -26,9 +26,9 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationType;
@@ -86,21 +86,19 @@
private InvocationHandler getInvocationHandler(Endpoint ep)
{
- Deployment dep = ep.getService().getDeployment();
- DeploymentType depType = dep.getType();
- String key = depType.toString();
+ String key = ep.getType().toString();
// Use a special key for MDB endpoints
- EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
+ EJBArchiveMetaData uapp = ep.getService().getDeployment().getAttachment(EJBArchiveMetaData.class);
if (uapp != null)
{
EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
- if (depType == DeploymentType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
+ if (ep.getType() == EndpointType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
{
key = InvocationType.JAXRPC_MDB21.toString();
}
- else if (depType == DeploymentType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
+ else if (ep.getType() == EndpointType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
{
key = InvocationType.JAXWS_MDB3.toString();
}
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -45,8 +45,7 @@
public void start(Deployment dep)
{
//TODO:set contextRoot to eache endpoint
- //String contextRoot = dep.getService().getContextRoot();
- String contextRoot = "";
+ String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
throw new IllegalStateException(BundleUtils.getMessage(bundle, "CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH", contextRoot));
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -107,8 +107,7 @@
try {
introsConfigStream.close();
} catch (IOException e) {
- //TODO:logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot() ), e);
- logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService()), e);
+ logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot()), e);
}
}
}
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -32,6 +32,7 @@
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
@@ -78,7 +79,7 @@
// #1 For JSE lookup the url-pattern from the servlet mappings
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
- if (webMetaData != null)
+ if (webMetaData != null && ep.getType() == EndpointType.JAXWS_JSE || ep.getType() == EndpointType.JAXRPC_JSE)
{
String epName = ep.getShortName();
urlPattern = webMetaData.getServletMappings().get(epName);
@@ -88,7 +89,8 @@
// #2 Use the explicit urlPattern from port-component/port-component-uri
EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
- if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
+ //TODO: look at EndpointType.JAXRPC_EJB21
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null && ep.getType() == EndpointType.JAXWS_EJB3)
{
EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
urlPattern = bmd.getPortComponentURI();
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -29,8 +29,8 @@
import org.jboss.ws.api.annotation.WebContext;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
/**
@@ -46,7 +46,7 @@
@Override
public void start(Deployment dep)
{
- if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
+ if (WSHelper.isEjbDeployment(dep) && !WSHelper.isJaxwsJseDeployment(dep))
{
dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
}
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -26,7 +26,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
/**
* Cross WS stack and JBoss AS integration helper.
@@ -102,7 +103,14 @@
*/
public static boolean isJaxrpcEjbDeployment( final Deployment dep )
{
- return DeploymentType.JAXRPC_EJB21.equals( dep.getType() );
+ return dep.getService().getEndpoints(new EndpointTypeFilter() {
+ public boolean accept(EndpointType type) {
+ if (type == EndpointType.JAXRPC_EJB21) {
+ return true;
+ }
+ return false;
+ }
+ }).size() > 0;
}
/**
@@ -113,7 +121,14 @@
*/
public static boolean isJaxrpcJseDeployment( final Deployment dep )
{
- return DeploymentType.JAXRPC_JSE.equals( dep.getType() );
+ return dep.getService().getEndpoints(new EndpointTypeFilter() {
+ public boolean accept(EndpointType type) {
+ if (type == EndpointType.JAXRPC_JSE) {
+ return true;
+ }
+ return false;
+ }
+ }).size() > 0;
}
/**
@@ -124,7 +139,15 @@
*/
public static boolean isJaxwsEjbDeployment( final Deployment dep )
{
- return DeploymentType.JAXWS_EJB3.equals( dep.getType() );
+ return dep.getService().getEndpoints(new EndpointTypeFilter() {
+ public boolean accept(EndpointType type) {
+ if (type == EndpointType.JAXWS_EJB3) {
+ return true;
+ }
+ return false;
+ }
+
+ }).size() > 0;
}
/**
@@ -135,7 +158,14 @@
*/
public static boolean isJaxwsJseDeployment( final Deployment dep )
{
- return DeploymentType.JAXWS_JSE.equals( dep.getType() );
+ return dep.getService().getEndpoints(new EndpointTypeFilter() {
+ public boolean accept(EndpointType type) {
+ if (type == EndpointType.JAXWS_JSE || type == EndpointType.JAXWS_JMS) {
+ return true;
+ }
+ return false;
+ }
+ }).size() > 0;
}
/**
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -36,6 +36,7 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -166,8 +167,8 @@
private void setRuntimeLoader()
{
final Deployment dep = endpoint.getService().getDeployment();
- final boolean isJaxrpcJse = dep.getType() == Deployment.DeploymentType.JAXRPC_JSE;
- final boolean isJaxwsJse = dep.getType() == Deployment.DeploymentType.JAXWS_JSE;
+ final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment(dep);
+ final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment(dep);
if (isJaxrpcJse || isJaxwsJse)
{
Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2011-09-02 05:42:04 UTC (rev 14924)
@@ -39,6 +39,7 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.IOUtils;
+import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -76,7 +77,7 @@
serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
}
- if (dep.getType().toString().endsWith("JSE"))
+ if (WSHelper.isJseDeployment(dep))
{
expLocation = "WEB-INF/wsdl/";
}
13 years, 4 months
JBossWS SVN: r14923 - spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-09-02 01:40:05 -0400 (Fri, 02 Sep 2011)
New Revision: 14923
Modified:
spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Service.java
Log:
[JBWS-3346]:Remove DeploymentType
Modified: spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java
===================================================================
--- spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2011-09-02 05:21:38 UTC (rev 14922)
+++ spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Deployment.java 2011-09-02 05:40:05 UTC (rev 14923)
@@ -21,6 +21,7 @@
*/
package org.jboss.wsf.spi.deployment;
+
/**
* A general web service deployment dep.
*
@@ -30,11 +31,7 @@
*/
public interface Deployment extends Extensible
{
- public enum DeploymentType
- {
- JAXRPC_JSE, JAXRPC_EJB21, JAXWS_JSE, JAXWS_EJB3, @Deprecated JAXWS_JMS;
- };
-
+
public enum DeploymentState
{
UNDEFINED, STARTED, STOPPED
@@ -58,12 +55,7 @@
/** Set the runtime class loader for this deployment */
void setRuntimeClassLoader(ClassLoader loader);
- /** Get the deployment type */
- DeploymentType getType();
- /** Set the deployment type */
- void setType(DeploymentType type);
-
/** Get the current deployment state */
DeploymentState getState();
@@ -75,4 +67,4 @@
/** Set the service associated with this deployment */
void setService(Service service);
-}
+}
\ No newline at end of file
Modified: spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java
===================================================================
--- spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2011-09-02 05:21:38 UTC (rev 14922)
+++ spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/DeploymentAspectManagerFactory.java 2011-09-02 05:40:05 UTC (rev 14923)
@@ -31,7 +31,7 @@
*/
public abstract class DeploymentAspectManagerFactory implements SPIView
{
- public abstract DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType);
+ //public abstract DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType);
/**
* Get a named instance of a deployment aspect manager
Modified: spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java
===================================================================
--- spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2011-09-02 05:21:38 UTC (rev 14922)
+++ spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java 2011-09-02 05:40:05 UTC (rev 14923)
@@ -145,10 +145,4 @@
/** get endpoint type */
EndpointType getType();
-
- /** Get the context root for this service */
- String getContextRoot();
-
- /** Set the context root for this service */
- void setContextRoot(String contextRoot);
}
Modified: spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Service.java
===================================================================
--- spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-09-02 05:21:38 UTC (rev 14922)
+++ spi/branches/JBWS-3343/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-09-02 05:40:05 UTC (rev 14923)
@@ -50,6 +50,12 @@
/** Get the list of endpoints with EndpointTypeFilter*/
List<Endpoint> getEndpoints(EndpointTypeFilter filter);
+ /** Get the endpoint type list */
+ List<EndpointType> getEndpointTypes();
+
+ /** Add endpoint type */
+ void addEndpointType(EndpointType type);
+
/** Get an endpoint by name */
Endpoint getEndpointByName(String simpleName);
@@ -59,4 +65,10 @@
/** Set the virtual hosts for this service */
void setVirtualHosts(List<String> virtualHosts);
+ /** Get the context root for this service */
+ String getContextRoot();
+
+ /** Set the context root for this service */
+ void setContextRoot(String contextRoot);
+
}
13 years, 4 months
JBossWS SVN: r14922 - in stack/cxf/trunk/modules/addons/transports/http/httpserver/src: test/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2011-09-02 01:21:38 -0400 (Fri, 02 Sep 2011)
New Revision: 14922
Modified:
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java
stack/cxf/trunk/modules/addons/transports/http/httpserver/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineTest.java
Log:
[JBWS-3347] - Enhanced synchronization logic to specifically lock on the static portMap object.
Modified: stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java
===================================================================
--- stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java 2011-09-01 13:26:14 UTC (rev 14921)
+++ stack/cxf/trunk/modules/addons/transports/http/httpserver/src/main/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineFactory.java 2011-09-02 05:21:38 UTC (rev 14922)
@@ -36,7 +36,8 @@
/**
* A server engine factory for the JDK6-based httpserver engine
- *
+ *
+ * @author Magesh Kumar B <mageshbk(a)jboss.com> (C) 2011 Red Hat Inc.
* @author alessio.soldano(a)jboss.com
* @since 19-Aug-2010
*
@@ -85,24 +86,33 @@
*/
public synchronized HttpServerEngine retrieveHttpServerEngine(int port)
{
- return portMap.get(port);
+ HttpServerEngine engine = null;
+ synchronized(portMap)
+ {
+ engine = portMap.get(port);
+ }
+ return engine;
}
public synchronized HttpServerEngine createHttpServerEngine(String host, int port, String protocol)
throws IOException
{
LOG.fine("Creating HttpServer Engine for port " + port + ".");
- HttpServerEngine ref = retrieveHttpServerEngine(port);
- if (null == ref)
+ HttpServerEngine ref = null;
+ synchronized(portMap)
{
- ref = new HttpServerEngine(this, bus, host, port);
- portMap.put(port, ref);
- }
- // checking the protocol
- if (!protocol.equals(ref.getProtocol()))
- {
- throw new IOException("Protocol mismatch for port " + port + ": " + "engine's protocol is "
+ ref = retrieveHttpServerEngine(port);
+ if (null == ref)
+ {
+ ref = new HttpServerEngine(this, bus, host, port);
+ portMap.put(port, ref);
+ }
+ // checking the protocol
+ if (!protocol.equals(ref.getProtocol()))
+ {
+ throw new IOException("Protocol mismatch for port " + port + ": " + "engine's protocol is "
+ ref.getProtocol() + ", the url protocol is " + protocol);
+ }
}
return ref;
}
@@ -112,18 +122,21 @@
*/
public synchronized void destroyForPort(int port)
{
- HttpServerEngine ref = portMap.remove(port);
- if (ref != null)
+ synchronized(portMap)
{
- LOG.fine("Stopping HttpServer Engine on port " + port + ".");
- try
+ HttpServerEngine ref = portMap.remove(port);
+ if (ref != null)
{
- ref.stop();
+ LOG.fine("Stopping HttpServer Engine on port " + port + ".");
+ try
+ {
+ ref.stop();
+ }
+ catch (Exception e)
+ {
+ LOG.log(Level.WARNING, "", e);
+ }
}
- catch (Exception e)
- {
- LOG.log(Level.WARNING, "", e);
- }
}
}
Modified: stack/cxf/trunk/modules/addons/transports/http/httpserver/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineTest.java
===================================================================
--- stack/cxf/trunk/modules/addons/transports/http/httpserver/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineTest.java 2011-09-01 13:26:14 UTC (rev 14921)
+++ stack/cxf/trunk/modules/addons/transports/http/httpserver/src/test/java/org/jboss/wsf/stack/cxf/addons/transports/httpserver/HttpServerEngineTest.java 2011-09-02 05:21:38 UTC (rev 14922)
@@ -25,27 +25,34 @@
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
+import java.util.Collections;
+import java.util.ArrayList;
+import java.util.List;
import junit.framework.TestCase;
import org.apache.cxf.Bus;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.configuration.spring.ConfigurerImpl;
+import org.apache.cxf.service.model.EndpointInfo;
import org.easymock.classextension.EasyMock;
import org.easymock.classextension.IMocksControl;
/**
* Tests for HttpServerEngine
*
+ * @author Magesh Kumar B <mageshbk(a)jboss.com> (C) 2011 Red Hat Inc.
* @author alessio.soldano(a)jboss.com
* @since 20-Aug-2010
*
*/
public class HttpServerEngineTest extends TestCase {
+ private static final int THREAD_COUNT = 50;
private Bus bus;
private IMocksControl control;
private HttpServerEngineFactory factory;
+ private static List<HttpServerEngine> servers = Collections.synchronizedList(new ArrayList<HttpServerEngine>());
public void setUp() throws Exception
@@ -82,6 +89,39 @@
control.verify();
}
+ public void testMultiThreaded()
+ {
+ Thread threads[] = new Thread[THREAD_COUNT];
+ int i = 0;
+ // Initialize the threads
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ threads[i] = new Thread(new FactoryInvoker());
+ }
+ // Start the threads
+ for (i = 0; i < THREAD_COUNT; i++)
+ {
+ threads[i].start();
+ }
+ // Wait for all threads to complete
+ while (servers.size() != THREAD_COUNT) {
+ try
+ {
+ Thread.sleep(100);
+ }
+ catch (InterruptedException ie)
+ {
+ // Ignore
+ }
+ }
+
+ HttpServerEngine sharedEngine = servers.get(0);
+ for (HttpServerEngine engine : servers)
+ {
+ assertEquals(sharedEngine, engine);
+ }
+ }
+
public void testHandler() throws Exception
{
MyTestHandler handler1 = new MyTestHandler();
@@ -139,4 +179,37 @@
}
}
+ private class FactoryInvoker implements Runnable
+ {
+ private HttpServerEngineFactory _factory;
+
+ FactoryInvoker()
+ {
+ _factory = new HttpServerEngineFactory(null);
+ }
+
+ public void run()
+ {
+ HttpServerEngine engine = null;
+ try
+ {
+ // Delay makes sure the try blocks are initialized before calling createHttpServerEngine,
+ // enhances the chance to enter the createHttpServerEngine simultaneously.
+ try
+ {
+ Thread.sleep(10);
+ }
+ catch (InterruptedException ie)
+ {
+ // Ignore
+ }
+ engine = _factory.createHttpServerEngine("127.0.0.1", 18001, "http");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ servers.add(engine);
+ }
+ }
}
13 years, 4 months
JBossWS SVN: r14921 - container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-09-01 09:26:14 -0400 (Thu, 01 Sep 2011)
New Revision: 14921
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
Log:
[JBWS-3348] get rid of org.jboss.ws.backward_compatible_context_root property
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-09-01 13:25:59 UTC (rev 14920)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-09-01 13:26:14 UTC (rev 14921)
@@ -29,7 +29,6 @@
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -109,7 +108,7 @@
.getWebserviceDescriptionMetaData(wsDescriptionsMD);
if (wsDescriptionMD != null)
{
- if (!Constants.BC_CONTEXT_MODE && contextRoot == null && !hasContextRoot(ejbArchiveMD))
+ if (contextRoot == null && !hasContextRoot(ejbArchiveMD))
{
contextRoot = wsDescriptionMD.getWebserviceDescriptionName(); // TCK6 fallback
}
13 years, 4 months
JBossWS SVN: r14920 - container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/metadata.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-09-01 09:25:59 -0400 (Thu, 01 Sep 2011)
New Revision: 14920
Modified:
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
Log:
[JBWS-3348] get rid of org.jboss.ws.backward_compatible_context_root property
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-09-01 13:23:39 UTC (rev 14919)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-09-01 13:25:59 UTC (rev 14920)
@@ -29,7 +29,6 @@
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.ejb.jboss.WebservicesMetaData;
import org.jboss.webservices.integration.util.ASHelper;
-import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -109,7 +108,7 @@
.getWebserviceDescriptionMetaData(wsDescriptionsMD);
if (wsDescriptionMD != null)
{
- if (!Constants.BC_CONTEXT_MODE && contextRoot == null && !hasContextRoot(ejbArchiveMD))
+ if (contextRoot == null && !hasContextRoot(ejbArchiveMD))
{
contextRoot = wsDescriptionMD.getWebserviceDescriptionName(); // TCK6 fallback
}
13 years, 4 months
JBossWS SVN: r14919 - in common/trunk/src/main/java/org/jboss/ws/common: deployment and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-09-01 09:23:39 -0400 (Thu, 01 Sep 2011)
New Revision: 14919
Modified:
common/trunk/src/main/java/org/jboss/ws/common/Constants.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
Log:
[JBWS-3348] get rid of org.jboss.ws.backward_compatible_context_root property
Modified: common/trunk/src/main/java/org/jboss/ws/common/Constants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Constants.java 2011-09-01 11:07:51 UTC (rev 14918)
+++ common/trunk/src/main/java/org/jboss/ws/common/Constants.java 2011-09-01 13:23:39 UTC (rev 14919)
@@ -331,6 +331,4 @@
static final String HTTP_MAX_CONNECTIONS = "org.jboss.ws.http.maxConnections";
static final String NETTY_MESSAGE = "org.jboss.ws.http.netty.Message";
-
- static final boolean BC_CONTEXT_MODE = Boolean.parseBoolean(System.getProperty("org.jboss.ws.backward_compatible_context_creator", "false"));
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-01 11:07:51 UTC (rev 14918)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2011-09-01 13:23:39 UTC (rev 14919)
@@ -27,7 +27,6 @@
import org.jboss.ws.api.annotation.TransportGuarantee;
import org.jboss.ws.api.annotation.WebContext;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -105,11 +104,6 @@
{
String simpleName = dep.getSimpleName();
String contextRoot = simpleName.substring(0, simpleName.length() - 4);
- if (dep.getParent() != null && Constants.BC_CONTEXT_MODE)
- {
- simpleName = dep.getParent().getSimpleName();
- contextRoot = simpleName.substring(0, simpleName.length() - 4) + "-" + contextRoot;
- }
return contextRoot;
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-01 11:07:51 UTC (rev 14918)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2011-09-01 13:23:39 UTC (rev 14919)
@@ -28,7 +28,6 @@
import org.jboss.ws.api.annotation.WebContext;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.Constants;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -41,7 +40,7 @@
* A deployer that assigns the URLPattern to endpoints.
*
* @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2007
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class URLPatternDeploymentAspect extends AbstractDeploymentAspect
{
@@ -60,7 +59,7 @@
{
urlPattern = getExplicitPattern(dep, ep);
if (urlPattern == null)
- urlPattern = getImplicitPattern(dep, ep);
+ urlPattern = ep.getShortName();
// Always prefix with '/'
if (urlPattern.startsWith("/") == false)
@@ -110,42 +109,45 @@
// #3 For EJB use @WebContext.urlPattern
if (urlPattern == null)
{
- Class beanClass = ep.getTargetBeanClass();
+ Class<?> beanClass = ep.getTargetBeanClass();
WebContext anWebContext = (WebContext)beanClass.getAnnotation(WebContext.class);
if (anWebContext != null && anWebContext.urlPattern().length() > 0)
{
urlPattern = anWebContext.urlPattern();
}
- else if (!Constants.BC_CONTEXT_MODE)
- {
- WebService webServiceAnnotation = (WebService)beanClass.getAnnotation(WebService.class);
- String name = webServiceAnnotation != null ? webServiceAnnotation.name() : null;
- if (name != null && name.length() > 0)
- {
- urlPattern = name;
- }
- else
- {
- String fullClassName = beanClass.getName();
- urlPattern = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
- }
- if (webServiceAnnotation != null && !"".equals(webServiceAnnotation.serviceName()))
- {
- urlPattern = webServiceAnnotation.serviceName() + "/" + urlPattern;
- }
-
- }
}
+
+ // #4 Use @WebService
+ if (urlPattern == null)
+ {
+ Class<?> beanClass = ep.getTargetBeanClass();
+ WebService webServiceAnnotation = (WebService)beanClass.getAnnotation(WebService.class);
+ if (webServiceAnnotation != null)
+ {
+ String name = webServiceAnnotation.name();
+ urlPattern = !isEmpty(name) ? name : beanClass.getSimpleName();
+ String serviceName = webServiceAnnotation.serviceName();
+ if (!isEmpty(serviceName))
+ {
+ urlPattern = serviceName + "/" + urlPattern;
+ }
+ }
+ }
+ // TODO: WebServiceProvider ???
+
+ // #5 Use simple class name
+ if (urlPattern == null)
+ {
+ Class<?> beanClass = ep.getTargetBeanClass();
+ urlPattern = beanClass.getSimpleName();
+ }
return urlPattern;
}
- protected String getImplicitPattern(Deployment dep, Endpoint ep)
- {
- // #4 Fallback to the ejb-name
- String urlPattern = ep.getShortName();
- return urlPattern;
+ private static boolean isEmpty(final String s) {
+ return s == null || s.length() == 0;
}
}
13 years, 4 months