Author: jim.ma
Date: 2010-04-15 00:03:22 -0400 (Thu, 15 Apr 2010)
New Revision: 11990
Added:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSEndpointsDescriptorParserDeployer.java
Modified:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2791]:1.Add the WSEndpointsDescriptorParserDeployer to parse the
jbossws-endpoints.xml in parse stage 2.Create deployment if there is only
jbossws-endpoints.xml descriptor, otherwise put the EndpointsMetaData in deployment
3.Change ASHelper.isWebserviceDeployment : if the deployment is not null then it is
WebseriviceDeployment. This will enable DeploymentAspect to handle the jms deployment.
Modified:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2010-04-15
02:25:22 UTC (rev 11989)
+++
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2010-04-15
04:03:22 UTC (rev 11990)
@@ -104,7 +104,8 @@
{
this.log.debug(this.aspect + " start: " + unit.getName());
final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
- this.aspect.start(dep);
+ if (aspect.canHandle(dep))
+ this.aspect.start(dep);
}
}
@@ -121,7 +122,8 @@
{
this.log.debug(this.aspect + " stop: " + unit.getName());
final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
- this.aspect.stop(dep);
+ if (aspect.canHandle(dep))
+ this.aspect.stop(dep);
}
}
Added:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSEndpointsDescriptorParserDeployer.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSEndpointsDescriptorParserDeployer.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/WSEndpointsDescriptorParserDeployer.java 2010-04-15
04:03:22 UTC (rev 11990)
@@ -0,0 +1,58 @@
+/*
+ * 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;
+
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.wsf.spi.metadata.endpoints.EndpointsFactory;
+import org.jboss.wsf.spi.metadata.endpoints.EndpointsMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+
+/**
+ * jbsssws-endpoints.xml Parser
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class WSEndpointsDescriptorParserDeployer extends
ObjectModelFactoryDeployer<EndpointsMetaData>
+{
+
+ /**
+ * Constructor.
+ */
+ public WSEndpointsDescriptorParserDeployer()
+ {
+ super(EndpointsMetaData.class);
+ }
+
+ /**
+ * Model factory generator.
+ *
+ * @param root object tree root
+ * @return object model factory
+ */
+ @Override
+ protected ObjectModelFactory getObjectModelFactory(final EndpointsMetaData root)
+ {
+ this.log.debug("Creating endpoints descrptor factory");
+ return new EndpointsFactory(null);
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2010-04-15
02:25:22 UTC (rev 11989)
+++
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2010-04-15
04:03:22 UTC (rev 11990)
@@ -26,7 +26,12 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.webservices.integration.util.ASHelper;
+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.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.metadata.endpoints.EndpointsMetaData;
/**
* JBossWS deployment model builder.
@@ -81,6 +86,27 @@
{
WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
}
+ //if the DeploymentUnit contains jbossws-endpoints.xml (jms endpoints)
+ if (ASHelper.hasAttachment(unit, EndpointsMetaData.class))
+ {
+ Deployment dep = ASHelper.getOptionalAttachment(unit, Deployment.class);
+ if (dep == null)
+ {
+ dep = buildDeploymentFromEndpointsMetaData(unit);
+ }
+
+ EndpointsMetaData endpointsMetaData = ASHelper.getRequiredAttachment(unit,
EndpointsMetaData.class);
+ dep.addAttachment(EndpointsMetaData.class, endpointsMetaData);
+ }
}
-
+
+ private Deployment buildDeploymentFromEndpointsMetaData(DeploymentUnit unit)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory deploymentModelFactory =
spiProvider.getSPI(DeploymentModelFactory.class);
+ Deployment dep = deploymentModelFactory.newDeployment(unit.getSimpleName(),
unit.getClassLoader());
+ //There is no SPI Service and Endpoint created and also there is no DeploymentType
+ //TODO:Review it if add deploymentType can make things easy
+ return dep;
+ }
}
Modified:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2010-04-15
02:25:22 UTC (rev 11989)
+++
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2010-04-15
04:03:22 UTC (rev 11990)
@@ -36,6 +36,7 @@
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
@@ -72,7 +73,7 @@
*/
public static boolean isWebServiceDeployment(final DeploymentUnit unit)
{
- return ASHelper.getOptionalAttachment(unit, DeploymentType.class) != null;
+ return ASHelper.getOptionalAttachment(unit, Deployment.class) != null;
}
/**
Modified:
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-04-15
02:25:22 UTC (rev 11989)
+++
container/jboss50/branches/jbossws-jboss510-jms-integration/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-04-15
04:03:22 UTC (rev 11990)
@@ -55,6 +55,11 @@
<property name="name">webservices.xml</property>
<property name="useSchemaValidation">true</property>
</bean>
+
+ <bean name="WSEndpointsDescriptorParserDeployer"
class="org.jboss.webservices.integration.deployers.WSEndpointsDescriptorParserDeployer">
+ <property name="name">jbossws-endpoints.xml</property>
+ <property name="useSchemaValidation">true</property>
+ </bean>
<bean name="WSEJBAdapterDeployer"
class="org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer"/>