Author: richard.opalka(a)jboss.com
Date: 2011-09-10 08:49:58 -0400 (Sat, 10 Sep 2011)
New Revision: 14970
Added:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
Removed:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-3351] code review
Added:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
(rev 0)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -0,0 +1,69 @@
+/*
+ * 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.WebServiceDeployment;
+import org.jboss.webservices.integration.deployers.deployment.WSDeploymentBuilder;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+
+/**
+ * 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(WebservicesMetaData.class);
+ this.addInput(WebServiceDeployment.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
+ {
+ log.trace("Building JBoss agnostic webservices meta data model");
+ WSDeploymentBuilder.getInstance().build(unit);
+ }
+}
Deleted:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -1,160 +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.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;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
-import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
-
-/**
- * Detects Web Service deployment type.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WSTypeDeployer extends AbstractRealDeployer
-{
- /**
- * Constructor.
- */
- public WSTypeDeployer()
- {
- super();
-
- // inputs
- this.addInput(JBossWebMetaData.class);
- this.addInput(WebservicesMetaData.class);
- this.addInput(WebServiceDeployment.class);
-
- // outputs
- this.addOutput(JBossWebMetaData.class);
- this.addOutput(Deployment.class);
- }
-
- /**
- * Detects WS deployment type and puts it to the deployment unit attachments.
- *
- * @param unit deployment unit
- * @throws DeploymentException on failure
- */
- @Override
- protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
- {
-
- if (this.isJaxwsJseDeployment(unit))
- {
- this.log.debug("Detected JAXWS JSE deployment");
- WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_JSE);
- }
- if (this.isJaxwsEjbDeployment(unit))
- {
- this.log.debug("Detected JAXWS EJB3 deployment");
- WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXWS_EJB3);
- }
- if (this.isJaxrpcJseDeployment(unit) && !isJaxwsJseDeployment(unit)
&& !isJaxwsEjbDeployment(unit))
- {
- this.log.debug("Detected JAXRPC JSE deployment");
- WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_JSE);
- }
- if (this.isJaxrpcEjbDeployment(unit) && !isJaxwsJseDeployment(unit)
&& !isJaxwsEjbDeployment(unit))
- {
- this.log.debug("Detected JAXRPC EJB21 deployment");
- WSDeploymentBuilder.getInstance().build(unit, EndpointType.JAXRPC_EJB21);
- }
- }
-
- /**
- * Returns true if JAXRPC EJB deployment is detected.
- *
- * @param unit deployment unit
- * @return true if JAXRPC EJB, false otherwise
- */
- private boolean isJaxrpcEjbDeployment(final DeploymentUnit unit)
- {
- final boolean hasWebservicesMD = ASHelper.hasAttachment(unit,
WebservicesMetaData.class);
- final boolean hasJBossMD = unit.getAllMetaData(JBossMetaData.class).size() > 0;
-
- return hasWebservicesMD && hasJBossMD;
- }
-
- /**
- * Returns true if JAXRPC JSE deployment is detected.
- *
- * @param unit deployment unit
- * @return true if JAXRPC JSE, false otherwise
- */
- private boolean isJaxrpcJseDeployment(final DeploymentUnit unit)
- {
- final boolean hasWebservicesMD = ASHelper.hasAttachment(unit,
WebservicesMetaData.class);
- final boolean hasJBossWebMD = ASHelper.hasAttachment(unit,
JBossWebMetaData.class);
-
- if (hasWebservicesMD && hasJBossWebMD)
- {
- return ASHelper.getJaxrpcServlets(unit).size() > 0;
- }
-
- return false;
- }
-
- /**
- * Returns true if JAXWS EJB deployment is detected.
- *
- * @param unit deployment unit
- * @return true if JAXWS EJB, false otherwise
- */
- private boolean isJaxwsEjbDeployment(final DeploymentUnit unit)
- {
- final boolean hasWSDeployment = ASHelper.hasAttachment(unit,
WebServiceDeployment.class);
-
- if (hasWSDeployment)
- {
- return ASHelper.getJaxwsEjbs(unit).size() > 0;
- }
-
- return false;
- }
-
- /**
- * Returns true if JAXWS JSE deployment is detected.
- *
- * @param unit deployment unit
- * @return true if JAXWS JSE, false otherwise
- */
- private boolean isJaxwsJseDeployment(final DeploymentUnit unit)
- {
- final boolean hasJBossWebMD = ASHelper.hasAttachment(unit,
JBossWebMetaData.class);
-
- if (hasJBossWebMD)
- {
- return ASHelper.getJaxwsServlets(unit).size() > 0;
- }
-
- return false;
- }
-}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -39,9 +39,10 @@
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.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.EndpointType;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -60,17 +61,23 @@
/** Deployment model factory. */
private final DeploymentModelFactory deploymentModelFactory;
+
+ /** Deployment type this builder creates. */
+ private final DeploymentType deploymentType;
+
+ /** Endpoint type this builder creates. */
+ private final EndpointType endpointType;
/**
* Constructor.
*/
- protected AbstractDeploymentModelBuilder()
+ protected AbstractDeploymentModelBuilder(final DeploymentType deploymentType, final
EndpointType endpointType)
{
- super();
-
// deployment factory
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
this.deploymentModelFactory = spiProvider.getSPI(DeploymentModelFactory.class);
+ this.deploymentType = deploymentType;
+ this.endpointType = endpointType;
}
/**
@@ -87,18 +94,11 @@
}
else
{
- try
- {
- dep = this.newDeployment(unit);
-
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
+ dep = this.newDeployment(unit);
dep.addAttachment(DeploymentUnit.class, unit);
unit.addAttachment(Deployment.class, dep);
}
+
this.build(dep, unit);
}
@@ -118,7 +118,7 @@
* @param dep deployment
* @return WS endpoint
*/
- protected final Endpoint newHttpEndpoint(final String endpointClass, final String
endpointName, final Deployment dep, final EndpointType endpointType)
+ protected final Endpoint newHttpEndpoint(final String endpointClass, final String
endpointName, final Deployment dep)
{
if (endpointName == null)
{
@@ -132,35 +132,8 @@
final Endpoint endpoint =
this.deploymentModelFactory.newHttpEndpoint(endpointClass);
endpoint.setShortName(endpointName);
- dep.getService().addEndpoint(endpoint);
endpoint.setType(endpointType);
- return endpoint;
- }
-
- /**
- * Creates new JMS Web Service endpoint.
- *
- * @param endpointClass endpoint class name
- * @param endpointName endpoint name
- * @param dep deployment
- * @return WS endpoint
- */
- protected final Endpoint newJMSEndpoint(final String endpointClass, final String
endpointName, final Deployment dep, final EndpointType endpointType)
- {
- if (endpointName == null)
- {
- throw new NullPointerException(BundleUtils.getMessage(bundle,
"NULL_ENDPOINT_NAME"));
- }
-
- if (endpointClass == null)
- {
- throw new NullPointerException(BundleUtils.getMessage(bundle,
"NULL_ENDPOINT_CLASS"));
- }
-
- final Endpoint endpoint =
this.deploymentModelFactory.newJMSEndpoint(endpointClass);
- endpoint.setShortName(endpointName);
dep.getService().addEndpoint(endpoint);
- endpoint.setType(endpointType);
return endpoint;
}
@@ -208,6 +181,7 @@
dep.setRootFile(new ResourceLoaderAdapter(unit.getClassLoader()));
}
dep.setRuntimeClassLoader(unit.getClassLoader());
+ dep.setType(deploymentType);
return dep;
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -21,11 +21,13 @@
*/
package org.jboss.webservices.integration.deployers.deployment;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXRPC;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_EJB21;
+
import org.jboss.deployers.structure.spi.DeploymentUnit;
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;
@@ -43,7 +45,7 @@
*/
DeploymentModelBuilderJAXRPC_EJB21()
{
- super();
+ super(JAXRPC, JAXRPC_EJB21);
}
/**
@@ -70,7 +72,7 @@
final String ejbClass = beanMetaData.getEjbClass();
this.log.debug("EJB21 class: " + ejbClass);
- this.newHttpEndpoint(ejbClass, ejbName, dep, EndpointType.JAXRPC_EJB21);
+ this.newHttpEndpoint(ejbClass, ejbName, dep);
}
}
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -21,12 +21,14 @@
*/
package org.jboss.webservices.integration.deployers.deployment;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXRPC;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_JSE;
+
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
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;
@@ -43,7 +45,7 @@
*/
DeploymentModelBuilderJAXRPC_JSE()
{
- super();
+ super(JAXRPC, JAXRPC_JSE);
}
/**
@@ -69,7 +71,7 @@
final String servletClass = ASHelper.getEndpointName(servletMD);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep,
EndpointType.JAXRPC_JSE);
+ this.newHttpEndpoint(servletClass, servletName, dep);
}
}
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -21,12 +21,14 @@
*/
package org.jboss.webservices.integration.deployers.deployment;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_EJB3;
+
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
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;
@@ -42,7 +44,7 @@
*/
DeploymentModelBuilderJAXWS_EJB3()
{
- super();
+ super(JAXWS, JAXWS_EJB3);
}
/**
@@ -65,7 +67,7 @@
final String ejbClass = container.getComponentClassName();
this.log.debug("EJB3 class: " + ejbClass);
- final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep,
EndpointType.JAXWS_EJB3);
+ final Endpoint ep = this.newHttpEndpoint(ejbClass, ejbName, dep);
ep.setProperty(ASHelper.CONTAINER_NAME, container.getContainerName());
}
}
Deleted:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.deployment;
-
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-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;
-
-/**
- * Create JAXWS SPI Deployment for JAXWS_JMS type deployment.
- *
- * @author <a herf="ema(a)redhat.com>Jim Ma</a>
- */
-public class DeploymentModelBuilderJAXWS_JMS extends AbstractDeploymentModelBuilder
-{
- /**
- * Constructor.
- */
- DeploymentModelBuilderJAXWS_JMS()
- {
- super();
- }
-
- /**
- * Creates new JAXWS JMS deployment and registers it with deployment unit.
- *
- * @param dep webservice deployment
- * @param unit deployment unit
- */
- @Override
- protected void build(final Deployment dep, final DeploymentUnit unit)
- {
- this.getAndPropagateAttachment(JMSEndpointsMetaData.class, unit, dep);
- JMSEndpointsMetaData jmsEndpointsMD =
dep.getAttachment(JMSEndpointsMetaData.class);
- for (JMSEndpointMetaData endpoint : jmsEndpointsMD.getEndpointsMetaData())
- {
- if (endpoint.getName() == null)
- {
- endpoint.setName(endpoint.getImplementor());
- }
- this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep,
EndpointType.JAXWS_JMS);
-
- }
- }
-}
\ No newline at end of file
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -21,6 +21,9 @@
*/
package org.jboss.webservices.integration.deployers.deployment;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
+import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
+
import java.util.List;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -28,7 +31,6 @@
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.
@@ -42,7 +44,7 @@
*/
DeploymentModelBuilderJAXWS_JSE()
{
- super();
+ super(JAXWS, JAXWS_JSE);
}
/**
@@ -65,7 +67,7 @@
final String servletClass = ASHelper.getEndpointName(servlet);
this.log.debug("JSE class: " + servletClass);
- this.newHttpEndpoint(servletClass, servletName, dep, EndpointType.JAXWS_JSE);
+ this.newHttpEndpoint(servletClass, servletName, dep);
}
}
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -21,11 +21,14 @@
*/
package org.jboss.webservices.integration.deployers.deployment;
-import java.util.HashMap;
-import java.util.Map;
+import static org.jboss.webservices.integration.util.ASHelper.isJaxrpcEjbDeployment;
+import static org.jboss.webservices.integration.util.ASHelper.isJaxrpcJseDeployment;
+import static org.jboss.webservices.integration.util.ASHelper.isJaxwsEjbDeployment;
+import static org.jboss.webservices.integration.util.ASHelper.isJaxwsJseDeployment;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.logging.Logger;
+import org.jboss.webservices.integration.util.ASHelper;
/**
* JBossWS deployment model builder.
@@ -34,21 +37,15 @@
*/
public final class WSDeploymentBuilder
{
+ private static final Logger log = Logger.getLogger(ASHelper.class);
/** Builder instance. */
private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
- /** Builders registry. */
- private static final Map<EndpointType, DeploymentModelBuilder> builders = new
HashMap<EndpointType, DeploymentModelBuilder>();
+ private static final DeploymentModelBuilder JAXWS_JSE = new
DeploymentModelBuilderJAXWS_JSE();
+ private static final DeploymentModelBuilder JAXRPC_JSE = new
DeploymentModelBuilderJAXRPC_JSE();
+ private static final DeploymentModelBuilder JAXWS_EJB = new
DeploymentModelBuilderJAXWS_EJB3();
+ private static final DeploymentModelBuilder JAXRPC_EJB = new
DeploymentModelBuilderJAXRPC_EJB21();
- static
- {
- 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());
- }
-
/**
* Constructor.
*/
@@ -72,12 +69,30 @@
*
* @param unit deployment unit
*/
- public void build(final DeploymentUnit unit, final EndpointType endpointType)
+ public void build(final DeploymentUnit unit)
{
-
- if (endpointType != null)
+ boolean isJaxwsDeployment = false;
+ if (isJaxwsJseDeployment(unit))
{
- WSDeploymentBuilder.builders.get(endpointType).newDeploymentModel(unit);
+ log.debug("Detected JAXWS JSE deployment");
+ JAXWS_JSE.newDeploymentModel(unit);
+ isJaxwsDeployment = true;
}
+ if (isJaxwsEjbDeployment(unit))
+ {
+ log.debug("Detected JAXWS EJB3 deployment");
+ JAXWS_EJB.newDeploymentModel(unit);
+ isJaxwsDeployment = true;
+ }
+ if (!isJaxwsDeployment && isJaxrpcJseDeployment(unit))
+ {
+ log.debug("Detected JAXRPC JSE deployment");
+ JAXRPC_JSE.newDeploymentModel(unit);
+ }
+ if (!isJaxwsDeployment && isJaxrpcEjbDeployment(unit))
+ {
+ log.debug("Detected JAXRPC EJB21 deployment");
+ JAXRPC_EJB.newDeploymentModel(unit);
+ }
}
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -38,7 +38,9 @@
*/
public final class InvocationHandlerFactoryImpl extends InvocationHandlerFactory
{
+
private static final ResourceBundle bundle =
BundleUtils.getBundle(InvocationHandlerFactoryImpl.class);
+
/**
* Constructor.
*/
@@ -59,28 +61,23 @@
switch (type)
{
- case JAXRPC_JSE :
- handler = new InvocationHandlerJAXRPC();
- break;
- case JAXRPC_EJB21 :
- handler = new InvocationHandlerEJB21();
- break;
- case JAXRPC_MDB21 :
- handler = new InvocationHandlerMDB21();
- break;
case JAXWS_JSE :
handler = new InvocationHandlerJAXWS();
break;
case JAXWS_EJB3 :
handler = new InvocationHandlerEJB3();
break;
- case JAXWS_MDB3 :
- handler = new InvocationHandlerMDB3();
+ case JAXRPC_JSE :
+ handler = new InvocationHandlerJAXRPC();
break;
+ case JAXRPC_EJB21 :
+ handler = new InvocationHandlerEJB21();
+ break;
default :
throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNABLE_TO_RESOLVE", type));
}
return handler;
}
+
}
Deleted:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -1,41 +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.invocation;
-
-import org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE;
-
-/**
- * Handles invocations on MDB EJB21 endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerMDB21 extends AbstractInvocationHandlerJSE
-{
- /**
- * Constructor.
- */
- InvocationHandlerMDB21()
- {
- super();
- }
-}
Deleted:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -1,41 +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.invocation;
-
-import org.jboss.ws.common.invocation.AbstractInvocationHandlerJSE;
-
-/**
- * Handles invocations on MDB EJB3 endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerMDB3 extends AbstractInvocationHandlerJSE
-{
- /**
- * Constructor.
- */
- InvocationHandlerMDB3()
- {
- super();
- }
-}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -66,13 +66,13 @@
final JSEArchiveMetaData jseMetaData = this.metaDataBuilderJSE.create(dep);
dep.addAttachment(JSEArchiveMetaData.class, jseMetaData);
}
- if (WSHelper.isJaxwsEjbDeployment(dep))
+ else if (WSHelper.isJaxwsEjbDeployment(dep))
{
this.log.debug("Creating JBoss agnostic EJB3 meta data for deployment:
" + dep.getSimpleName());
final EJBArchiveMetaData ejbMetaData = this.metaDataBuilderEJB3.create(dep);
dep.addAttachment(EJBArchiveMetaData.class, ejbMetaData);
}
- if (WSHelper.isJaxrpcEjbDeployment(dep) &&
!WSHelper.isJaxwsJseDeployment(dep) && !WSHelper.isJaxwsEjbDeployment(dep))
+ else if (WSHelper.isJaxrpcEjbDeployment(dep))
{
this.log.debug("Creating JBoss agnostic EJB21 meta data for deployment:
" + dep.getSimpleName());
final EJBArchiveMetaData ejbMetaData = this.metaDataBuilderEJB21.create(dep);
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -25,7 +25,6 @@
import java.util.List;
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
import org.jboss.metadata.javaee.spec.PortComponent;
@@ -34,7 +33,6 @@
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.SLSBMetaData;
/**
@@ -45,6 +43,7 @@
*/
final class MetaDataBuilderEJB21 extends AbstractMetaDataBuilderEJB
{
+
/**
* Constructor.
*/
@@ -73,7 +72,7 @@
ejbArchiveMD.setEnterpriseBeans(wsEjbsMD);
final String securityDomain = jbossMetaData.getSecurityDomain();
- this.log.debug("Setting security domain: " + securityDomain);
+ log.debug("Setting security domain: " + securityDomain);
ejbArchiveMD.setSecurityDomain(securityDomain);
}
@@ -86,7 +85,7 @@
private void buildEnterpriseBeanMetaData(final List<EJBMetaData> wsEjbsMD,
final JBossEnterpriseBeanMetaData jbossEjbMD)
{
- final EJBMetaData wsEjbMD = this.newEjbMetaData(jbossEjbMD);
+ final EJBMetaData wsEjbMD = newEjbMetaData(jbossEjbMD);
if (wsEjbMD != null)
{
@@ -135,22 +134,10 @@
*/
private EJBMetaData newEjbMetaData(final JBossEnterpriseBeanMetaData jbossEjbMD)
{
- if (jbossEjbMD.isSession())
- {
- this.log.debug("Creating JBoss agnostic EJB21 meta data for session bean:
" + jbossEjbMD.getEjbClass());
- return new SLSBMetaData();
- }
- else if (jbossEjbMD.isMessageDriven())
- {
- this.log.debug("Creating JBoss agnostic EJB21 meta data for message driven
bean: " + jbossEjbMD.getEjbClass());
- final MDBMetaData mdbMD = new MDBMetaData();
+ if (!jbossEjbMD.isSession()) return null;
- final JBossMessageDrivenBeanMetaData jbossMessageBean =
(JBossMessageDrivenBeanMetaData) jbossEjbMD;
- ((MDBMetaData)
mdbMD).setDestinationJndiName(jbossMessageBean.getDestinationJndiName());
-
- return mdbMD;
- }
-
- return null;
+ log.debug("Creating JBoss agnostic EJB21 meta data for session bean: " +
jbossEjbMD.getEjbClass());
+ return new SLSBMetaData();
}
+
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -24,9 +24,6 @@
import java.util.LinkedList;
import java.util.List;
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-
import org.jboss.ws.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.webservices.integration.WebServiceDeclaration;
@@ -34,7 +31,6 @@
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.PortComponentSpec;
import org.jboss.wsf.spi.metadata.j2ee.SLSBMetaData;
@@ -82,7 +78,7 @@
*/
private void buildEnterpriseBeanMetaData(final List<EJBMetaData> wsEjbsMD, final
WebServiceDeclaration jbossEjbMD)
{
- final EJBMetaData wsEjbMD = this.newEjbMetaData(jbossEjbMD);
+ final EJBMetaData wsEjbMD = newEjbMetaData(jbossEjbMD);
if (wsEjbMD != null)
{
@@ -118,47 +114,8 @@
*/
private EJBMetaData newEjbMetaData(final WebServiceDeclaration jbossEjbMD)
{
- final MessageDriven mdbAnnotation = jbossEjbMD.getAnnotation(MessageDriven.class);
-
- if (mdbAnnotation == null)
- {
- this.log.debug("Creating JBoss agnostic EJB3 meta data for session bean:
"
- + jbossEjbMD.getComponentClassName());
- return new SLSBMetaData();
- }
- else
- {
- this.log.debug("Creating JBoss agnostic EJB3 meta data for message driven
bean: "
- + jbossEjbMD.getComponentClassName());
- final MDBMetaData mdbMD = new MDBMetaData();
-
- final String destinationName =
this.getActivationProperty("destination", mdbAnnotation.activationConfig());
- mdbMD.setDestinationJndiName(destinationName);
-
- return mdbMD;
- }
+ log.debug("Creating JBoss agnostic EJB3 meta data for session bean: " +
jbossEjbMD.getComponentClassName());
+ return new SLSBMetaData();
}
- /**
- * Returns activation config property value or null if not found.
- *
- * @param name activation property name
- * @param activationConfigProperties activation config properties
- * @return activation config property value
- */
- private String getActivationProperty(final String name, final
ActivationConfigProperty[] activationConfigProperties)
- {
- if (activationConfigProperties != null)
- {
- for (final ActivationConfigProperty activationConfigProperty :
activationConfigProperties)
- {
- if (activationConfigProperty.propertyName().equals(name))
- {
- return activationConfigProperty.propertyValue();
- }
- }
- }
-
- return null;
- }
}
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-09-10
12:49:58 UTC (rev 14970)
@@ -34,11 +34,13 @@
import org.jboss.logging.Logger;
import org.jboss.metadata.common.jboss.WebserviceDescriptionMetaData;
import org.jboss.metadata.common.jboss.WebserviceDescriptionsMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.web.jboss.JBossServletMetaData;
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;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
import org.jboss.webservices.integration.WebServiceDeclaration;
import org.jboss.webservices.integration.WebServiceDeployment;
@@ -77,9 +79,76 @@
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 boolean hasWebservicesMD = hasAttachment(unit, WebservicesMetaData.class);
+ final boolean hasJBossMD = unit.getAllMetaData(JBossMetaData.class).size() > 0;
+ return hasWebservicesMD && hasJBossMD;
+ }
/**
+ * 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 boolean hasWebservicesMD = hasAttachment(unit, WebservicesMetaData.class);
+ final boolean hasJBossWebMD = hasAttachment(unit, JBossWebMetaData.class);
+
+ if (hasWebservicesMD && hasJBossWebMD)
+ {
+ return getJaxrpcServlets(unit).size() > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * 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 boolean hasWSDeployment = hasAttachment(unit, WebServiceDeployment.class);
+
+ if (hasWSDeployment)
+ {
+ return getJaxwsEjbs(unit).size() > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * 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 boolean hasJBossWebMD = ASHelper.hasAttachment(unit,
JBossWebMetaData.class);
+
+ if (hasJBossWebMD)
+ {
+ return ASHelper.getJaxwsServlets(unit).size() > 0;
+ }
+
+ return false;
+ }
+
+ /**
* Gets list of JAXWS servlets meta data.
*
* @param unit deployment unit
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-10
12:47:18 UTC (rev 14969)
+++
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-09-10
12:49:58 UTC (rev 14970)
@@ -60,7 +60,7 @@
<bean name="WSEJBAdapterDeployer"
class="org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer"/>
- <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">