Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:10 -0500 (Sat, 23 Dec 2006)
New Revision: 1770
Added:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
Removed:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
Log:
Fix jse deployement for jboss42
Copied:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java
(from rev 1762,
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java)
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-23
19:20:31 UTC (rev 1762)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerEJB.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss50;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * An abstract deployer for EJB Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerEJB extends AbstractDeployer
+{
+ @Override
+ protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
+ {
+ // Create the service endpoint
+ super.createServiceEndpoint(udi, unit);
+
+ // Generate the webapp and publish through th publisher
+ try
+ {
+ UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
+ udi.webappURL = new
ServiceEndpointGeneratorEJB3().generatWebDeployment(wsMetaData, unit);
+ unit.addAttachment(ServiceEndpointWebApp.class, new
ServiceEndpointWebApp(udi.webappURL));
+ getServiceEndpointPublisher().publishServiceEndpoint(udi);
+ }
+ catch (Exception ex)
+ {
+ DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
+ }
+ }
+
+ @Override
+ protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
+ {
+ // Destroy the webapp
+ URL warURL = unit.getAttachment(ServiceEndpointWebApp.class).getWarURL();
+ try
+ {
+ getServiceEndpointPublisher().destroyServiceEndpoint(udi);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot destroy service endpoint: " + warURL, ex);
+ }
+
+ // Destroy the service endpoint
+ super.destroyServiceEndpoint(udi, unit);
+ }
+
+ static class ServiceEndpointWebApp
+ {
+ private URL warURL;
+
+ ServiceEndpointWebApp(URL warURL)
+ {
+ this.warURL = warURL;
+ }
+
+ public URL getWarURL()
+ {
+ return warURL;
+ }
+ }
+}
Copied:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
(from rev 1762,
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java)
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-23
19:20:31 UTC (rev 1762)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss50;
+
+//$Id$
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.metadata.NameValuePair;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
+
+/**
+ * An abstract deployer for JSE Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public abstract class AbstractDeployerJSE extends AbstractDeployer
+{
+ public AbstractDeployerJSE()
+ {
+ super();
+ super.setRelativeOrder(CLASSLOADER_DEPLOYER + 1);
+ }
+
+ /**
+ * After the service endpoint has successfully been deployed to the
ServiceEndpointManager,
+ *
+ */
+ @Override
+ protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
+ {
+ // Call the super implementation
+ super.deployServiceEndpoint(unit);
+
+ // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
+ InputStream stream =
unit.getDeploymentContext().getRoot().findChild("WEB-INF/web.xml").openStream();
+ RewriteResults results = getServiceEndpointPublisher().rewriteWebXml(stream, null,
unit.getClassLoader());
+
+ URL webXML = results.webXML;
+ modifyWebMetaData(unit, webXML);
+ }
+
+ private void modifyWebMetaData(DeploymentUnit unit, URL webXML) throws Exception
+ {
+ Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
+ if (allMetaData.size() < 1)
+ throw new DeploymentException("Cannot find WebMetaData");
+
+ WebMetaData webMetaData = allMetaData.iterator().next();
+ String serviceEndpointServlet =
getServiceEndpointPublisher().getServiceEndpointServlet();
+
+ Iterator it = webMetaData.getServlets().iterator();
+ while (it.hasNext())
+ {
+ Servlet servlet = (Servlet)it.next();
+ String servletClassName = servlet.getServletClass();
+
+ // JSP
+ if (servletClassName == null)
+ continue;
+
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servlet) == false)
+ {
+ servlet.setServletClass(serviceEndpointServlet);
+ NameValuePair initParam = new
NameValuePair(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL,
servletClassName);
+ servlet.addInitParam(initParam);
+ }
+ }
+
+ // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
+ String webXmlPath = webXML.getPath();
+ webMetaData.setAltDDPath(webXmlPath);
+ }
+
+ private boolean isAlreadyModified(Servlet servlet)
+ {
+ Iterator itParams = servlet.getInitParams().iterator();
+ while (itParams.hasNext())
+ {
+ NameValuePair pair = (NameValuePair)itParams.next();
+ if
(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(pair.getName()))
+ return true;
+ }
+ return false;
+ }
+}
Deleted:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-23
22:57:14 UTC (rev 1769)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractEJBDeployer.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * An abstract deployer for EJB Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractEJBDeployer extends AbstractDeployer
-{
- @Override
- protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws Exception
- {
- // Create the service endpoint
- super.createServiceEndpoint(udi, unit);
-
- // Generate the webapp and publish through th publisher
- try
- {
- UnifiedMetaData wsMetaData =
getServiceEndpointDeployer().getUnifiedMetaData(udi);
- udi.webappURL = new
ServiceEndpointGeneratorEJB3().generatWebDeployment(wsMetaData, unit);
- unit.addAttachment(ServiceEndpointWebApp.class, new
ServiceEndpointWebApp(udi.webappURL));
- getServiceEndpointPublisher().publishServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
- }
- }
-
- @Override
- protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
- {
- // Destroy the webapp
- URL warURL = unit.getAttachment(ServiceEndpointWebApp.class).getWarURL();
- try
- {
- getServiceEndpointPublisher().destroyServiceEndpoint(udi);
- }
- catch (Exception ex)
- {
- log.error("Cannot destroy service endpoint: " + warURL, ex);
- }
-
- // Destroy the service endpoint
- super.destroyServiceEndpoint(udi, unit);
- }
-
- static class ServiceEndpointWebApp
- {
- private URL warURL;
-
- ServiceEndpointWebApp(URL warURL)
- {
- this.warURL = warURL;
- }
-
- public URL getWarURL()
- {
- return warURL;
- }
- }
-}
Deleted:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-23
22:57:14 UTC (rev 1769)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-//$Id$
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.metadata.NameValuePair;
-import org.jboss.metadata.WebMetaData;
-import org.jboss.metadata.web.Servlet;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
-
-/**
- * An abstract deployer for JSE Endpoints
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2006
- */
-public abstract class AbstractJSEDeployer extends AbstractDeployer
-{
- public AbstractJSEDeployer()
- {
- super();
- super.setRelativeOrder(CLASSLOADER_DEPLOYER + 1);
- }
-
- /**
- * After the service endpoint has successfully been deployed to the
ServiceEndpointManager,
- *
- */
- @Override
- protected void deployServiceEndpoint(DeploymentUnit unit) throws Exception
- {
- // Call the super implementation
- super.deployServiceEndpoint(unit);
-
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- InputStream stream =
unit.getDeploymentContext().getRoot().findChild("WEB-INF/web.xml").openStream();
- RewriteResults results = getServiceEndpointPublisher().rewriteWebXml(stream, null,
unit.getClassLoader());
-
- URL webXML = results.webXML;
- modifyWebMetaData(unit, webXML);
- }
-
- private void modifyWebMetaData(DeploymentUnit unit, URL webXML) throws Exception
- {
- Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
- if (allMetaData.size() < 1)
- throw new DeploymentException("Cannot find WebMetaData");
-
- WebMetaData webMetaData = allMetaData.iterator().next();
- String serviceEndpointServlet =
getServiceEndpointPublisher().getServiceEndpointServlet();
-
- Iterator it = webMetaData.getServlets().iterator();
- while (it.hasNext())
- {
- Servlet servlet = (Servlet)it.next();
- String servletClassName = servlet.getServletClass();
-
- // JSP
- if (servletClassName == null)
- continue;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet) == false)
- {
- servlet.setServletClass(serviceEndpointServlet);
- NameValuePair initParam = new
NameValuePair(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL,
servletClassName);
- servlet.addInitParam(initParam);
- }
- }
-
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- String webXmlPath = webXML.getPath();
- webMetaData.setAltDDPath(webXmlPath);
- }
-
- private boolean isAlreadyModified(Servlet servlet)
- {
- Iterator itParams = servlet.getInitParams().iterator();
- while (itParams.hasNext())
- {
- NameValuePair pair = (NameValuePair)itParams.next();
- if
(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(pair.getName()))
- return true;
- }
- return false;
- }
-}
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-23
22:57:14 UTC (rev 1769)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -40,7 +40,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXRPCDeployerJSE extends AbstractJSEDeployer
+public class JAXRPCDeployerJSE extends AbstractDeployerJSE
{
@Override
protected DeploymentType getDeploymentType()
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-23
22:57:14 UTC (rev 1769)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -43,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXWSDeployerEJB3 extends AbstractEJBDeployer
+public class JAXWSDeployerEJB3 extends AbstractDeployerEJB
{
@Override
protected DeploymentType getDeploymentType()
Modified:
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
---
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-23
22:57:14 UTC (rev 1769)
+++
branches/tdiesler/trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-24
00:55:10 UTC (rev 1770)
@@ -43,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Oct-2005
*/
-public class JAXWSDeployerJSE extends AbstractJSEDeployer
+public class JAXWSDeployerJSE extends AbstractDeployerJSE
{
@Override
protected DeploymentType getDeploymentType()