Author: thomas.diesler(a)jboss.com
Date: 2007-04-25 15:29:13 -0400 (Wed, 25 Apr 2007)
New Revision: 2924
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MetaDataInitDeployer.java
Removed:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InitializeMetaDataDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppPublishingDeployer.java
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
Log:
More general purpose WS integration
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -69,7 +69,7 @@
throw new DeploymentException("Cannot find WebMetaData");
WebMetaData webMetaData = allMetaData.iterator().next();
- String serviceEndpointServlet =
getServiceEndpointPublisher().getServiceEndpointServlet();
+ String servletClass = getServiceEndpointPublisher().getServletClass();
Iterator it = webMetaData.getServlets().iterator();
while (it.hasNext())
@@ -84,7 +84,7 @@
// Nothing to do if we have an <init-param>
if (isAlreadyModified(servlet) == false && isAServlet(servletClassName,
unit.getClassLoader()) == false)
{
- servlet.setServletClass(serviceEndpointServlet);
+ servlet.setServletClass(servletClass);
NameValuePair initParam = new NameValuePair(Endpoint.SEPID_DOMAIN_ENDPOINT,
servletClassName);
servlet.addInitParam(initParam);
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -87,9 +87,13 @@
udi.metaData = ApplicationMetaDataAdaptor.buildUnifiedApplicationMetaData(udi,
unit);
}
else if (unit.getAttachment(WebMetaData.class) != null)
- {
- udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(udi, unit);
- udi.webappURL = udi.vfRoot.toURL();
- }
+ {
+ udi.metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(udi, unit);
+ udi.webappURL = udi.vfRoot.toURL();
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot build meta data");
+ }
}
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AbstractServiceEndpointServlet.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -55,12 +55,12 @@
private static final Logger log =
Logger.getLogger(AbstractServiceEndpointServlet.class);
protected Endpoint endpoint;
- protected EndpointRegistry epManager;
+ protected EndpointRegistry epRegistry;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
- epManager = EndpointRegistryFactory.getEndpointRegistry();
+ epRegistry = EndpointRegistryFactory.getEndpointRegistry();
}
public void destroy()
@@ -140,13 +140,13 @@
if (contextPath.startsWith("/"))
contextPath = contextPath.substring(1);
- for (ObjectName sepId : epManager.getEndpoints())
+ for (ObjectName sepId : epRegistry.getEndpoints())
{
String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
if (servletName.equals(propEndpoint) &&
contextPath.equals(propContext))
{
- endpoint = epManager.getEndpoint(sepId);
+ endpoint = epRegistry.getEndpoint(sepId);
break;
}
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ArchiveDeployerHook.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -154,21 +154,4 @@
}
return wsMetaData;
}
-
- protected ObjectName createEndpointName(String contextRoot, String linkName)
- {
- if (contextRoot == null)
- throw new IllegalArgumentException("contextRoot cannot be null");
- if (linkName == null)
- throw new IllegalArgumentException("linkName cannot be null");
-
- if (contextRoot.startsWith("/"))
- contextRoot = contextRoot.substring(1);
-
- StringBuilder idstr = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
- idstr.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot);
- idstr.append("," + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" +
linkName);
-
- return ObjectNameFactory.create(idstr.toString());
- }
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/AssignEndpointMetaDataDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -54,6 +54,7 @@
if (sepMetaData == null)
{
sepMetaData = getEndpointMetaData(umd, ep.getName());
+ sepMetaData.setServiceEndpointImplName(ep.getEndpointImpl().getName());
ep.addMetaData(ServerEndpointMetaData.class, sepMetaData);
}
}
Added:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -0,0 +1,66 @@
+/*
+ * 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.jbossws;
+
+//$Id$
+
+import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.ObjectNameFactory;
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+
+/**
+ * A deployer that assigns the complete name to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class EndpointNameDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ ServerEndpointMetaData sepMetaData =
ep.getMetaData(ServerEndpointMetaData.class);
+ if (sepMetaData == null)
+ throw new IllegalStateException("Cannot obtain endpoint meta
data");
+
+ String linkName = sepMetaData.getLinkName();
+ if (linkName == null)
+ throw new IllegalStateException("Link name cannot be null");
+
+ String contextRoot = sepMetaData.getContextRoot();
+ if (contextRoot == null)
+ throw new IllegalStateException("Context root cannot be null");
+
+ if (contextRoot.startsWith("/"))
+ contextRoot = contextRoot.substring(1);
+
+ StringBuilder nameStr = new StringBuilder(Endpoint.SEPID_DOMAIN);
+ nameStr.append(":" + Endpoint.SEPID_PROPERTY_CONTEXT + "=" +
contextRoot);
+ nameStr.append("," + Endpoint.SEPID_PROPERTY_ENDPOINT + "="
+ linkName);
+ ep.setName(ObjectNameFactory.create(nameStr.toString()));
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/EndpointNameDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InitializeMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InitializeMetaDataDeployer.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InitializeMetaDataDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -1,47 +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.jbossws;
-
-//$Id$
-
-import org.jboss.ws.integration.deployment.AbstractDeployer;
-import org.jboss.ws.integration.deployment.Deployment;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * A deployer that initializes the UMDM
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InitializeMetaDataDeployer extends AbstractDeployer
-{
- @Override
- public void create(Deployment dep)
- {
- UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
- if (umd == null)
- throw new IllegalStateException("Cannot obtain unified meta data");
-
- umd.eagerInitialize();
- }
-}
\ No newline at end of file
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InvocationHandlerEJB21.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -83,7 +83,7 @@
throw new WSException("Cannot obtain ejb-link from port component");
UnifiedDeploymentInfo udi =
endpoint.getService().getDeployment().getContext().getAttachment(UnifiedDeploymentInfo.class);
- UnifiedApplicationMetaData applMetaData =
udi.getAttachment(UnifiedApplicationMetaData.class);
+ UnifiedApplicationMetaData applMetaData =
(UnifiedApplicationMetaData)udi.metaData;
UnifiedBeanMetaData beanMetaData =
(UnifiedBeanMetaData)applMetaData.getBeanByEjbName(ejbName);
if (beanMetaData == null)
throw new WSException("Cannot obtain ejb meta data for: " + ejbName);
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookEJB21.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -26,9 +26,9 @@
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.ApplicationMetaData.Webservices;
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
@@ -73,19 +73,6 @@
deployment.getContext().addAttachment(WebservicesMetaData.class, wsMetaData);
deployment.getContext().addAttachment(ApplicationMetaData.class, appmd);
- // Get the context root
- String contextRoot = null;
- Webservices webservices = appmd.getWebservices();
- if (webservices != null)
- contextRoot = webservices.getContextRoot();
-
- if (contextRoot == null)
- {
- contextRoot = unit.getSimpleName();
- if (contextRoot.endsWith(".jar"))
- contextRoot = contextRoot.substring(0, contextRoot.length() - 4);
- }
-
for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
{
for (PortComponentMetaData pcmd : wsd.getPortComponents())
@@ -113,7 +100,8 @@
// Create the endpoint
Endpoint endpoint = new BasicEndpoint(service, ejbClass);
- endpoint.setName(createEndpointName(contextRoot, ejbLink));
+ String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbLink;
+ endpoint.setName(ObjectNameFactory.create(nameStr));
service.addEndpoint(endpoint);
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/JAXRPCDeployerHookJSE.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -28,6 +28,7 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.ws.integration.BasicEndpoint;
import org.jboss.ws.integration.Endpoint;
+import org.jboss.ws.integration.ObjectNameFactory;
import org.jboss.ws.integration.Service;
import org.jboss.ws.integration.deployment.BasicDeployment;
import org.jboss.ws.integration.deployment.Deployment;
@@ -109,7 +110,8 @@
// Create the endpoint
Endpoint endpoint = new BasicEndpoint(service, servletClass);
- endpoint.setName(createEndpointName(contextRoot, servletLink));
+ String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletLink;
+ endpoint.setName(ObjectNameFactory.create(nameStr));
service.addEndpoint(endpoint);
}
Copied:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MetaDataInitDeployer.java
(from rev 2923,
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/InitializeMetaDataDeployer.java)
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MetaDataInitDeployer.java
(rev 0)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/MetaDataInitDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbossws;
+
+//$Id$
+
+import org.jboss.ws.integration.deployment.AbstractDeployer;
+import org.jboss.ws.integration.deployment.Deployment;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A deployer that initializes the UMDM
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class MetaDataInitDeployer extends AbstractDeployer
+{
+ @Override
+ public void create(Deployment dep)
+ {
+ UnifiedMetaData umd = dep.getContext().getAttachment(UnifiedMetaData.class);
+ if (umd == null)
+ throw new IllegalStateException("Cannot obtain unified meta data");
+
+ umd.eagerInitialize();
+ }
+}
\ No newline at end of file
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/ModifyWebMetaDataDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -25,15 +25,11 @@
import java.util.Iterator;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
import org.jboss.metadata.NameValuePair;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.KernelLocator;
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
@@ -45,15 +41,19 @@
*/
public class ModifyWebMetaDataDeployer extends AbstractDeployer
{
- public String getServiceEndpointServlet()
+ // The service endpoint servlet that is specific for the deployed stack
+ private String servletClass;
+
+ public String getServletClass()
{
- Kernel kernel = KernelLocator.getKernel();
- KernelRegistry registry = kernel.getRegistry();
- KernelRegistryEntry entry = registry.getEntry(WebXMLRewritingDeployer.BEAN_NAME);
- WebXMLRewritingDeployer delegate = (WebXMLRewritingDeployer)entry.getTarget();
- return delegate.getServiceEndpointServlet();
+ return servletClass;
}
+ public void setServletClass(String servletName)
+ {
+ this.servletClass = servletName;
+ }
+
@Override
public void create(Deployment dep)
{
@@ -62,16 +62,16 @@
{
for (Servlet servlet : webMetaData.getServlets())
{
- String servletClassName = servlet.getServletClass();
+ String endpointImpl = servlet.getServletClass();
// JSP
- if (servletClassName != null && servletClassName.length() > 0)
+ if (endpointImpl != null && endpointImpl.length() > 0)
{
// Nothing to do if we have an <init-param>
- if (!isAlreadyModified(servlet) &&
!isJavaxServlet(servletClassName, dep.getClassLoader()))
+ if (!isAlreadyModified(servlet) && !isJavaxServlet(endpointImpl,
dep.getClassLoader()))
{
- servlet.setServletClass(getServiceEndpointServlet());
- NameValuePair initParam = new
NameValuePair(Endpoint.SEPID_DOMAIN_ENDPOINT, servletClassName);
+ servlet.setServletClass(getServletClass());
+ NameValuePair initParam = new
NameValuePair(Endpoint.SEPID_DOMAIN_ENDPOINT, endpointImpl);
servlet.addInitParam(initParam);
}
}
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppPublishingDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppPublishingDeployer.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebAppPublishingDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -50,10 +50,10 @@
{
// provide logging
private static Logger log = Logger.getLogger(WebAppPublishingDeployer.class);
-
+
private MainDeployer mainDeployer;
private Map<String, DeploymentContext> contextMap = new HashMap<String,
DeploymentContext>();
-
+
public MainDeployer getMainDeployer()
{
return mainDeployer;
@@ -69,18 +69,18 @@
UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
if (udi == null)
throw new IllegalStateException("Cannot obtain unified deployement
info");
-
+
URL warURL = udi.webappURL;
log.debug("publishServiceEndpoint: " + warURL);
- try
+ try
{
rewriteWebXml(udi);
DeploymentContext context = createDeploymentContext(warURL);
-
+
mainDeployer.addDeploymentContext(context);
mainDeployer.process();
-
+
contextMap.put(warURL.toExternalForm(), context);
}
catch (Exception ex)
@@ -94,16 +94,16 @@
UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
if (udi == null)
throw new IllegalStateException("Cannot obtain unified deployement
info");
-
+
URL warURL = udi.webappURL;
if (warURL == null)
{
log.error("Cannot obtain warURL for: " + udi.name);
return;
}
-
+
log.debug("destroyServiceEndpoint: " + warURL);
- try
+ try
{
DeploymentContext context = contextMap.get(warURL.toExternalForm());
if (context != null)
@@ -111,7 +111,7 @@
context.setState(DeploymentState.UNDEPLOYING);
mainDeployer.process();
mainDeployer.removeDeploymentContext(context.getName());
-
+
contextMap.remove(warURL.toExternalForm());
}
}
Deleted:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/jbossws/WebXMLRewritingDeployer.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -1,256 +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.jbossws;
-
-//$Id$
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.Servlet;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.integration.Endpoint;
-import org.jboss.ws.integration.deployment.AbstractDeployer;
-import org.jboss.ws.integration.deployment.Deployment;
-import org.w3c.dom.Element;
-
-/**
- * A deployer that rewrites the web.xml
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class WebXMLRewritingDeployer extends AbstractDeployer
-{
- // The default bean name
- public static final Object BEAN_NAME = "WSWebXMLRewritingDeployer";
-
- // The service endpoint servlet that is specific for the deployed stack
- private String serviceEndpointServlet;
-
- public String getServiceEndpointServlet()
- {
- return serviceEndpointServlet;
- }
-
- public void setServiceEndpointServlet(String servletName)
- {
- this.serviceEndpointServlet = servletName;
- }
-
- @Override
- public void create(Deployment dep)
- {
- UnifiedDeploymentInfo udi =
dep.getContext().getAttachment(UnifiedDeploymentInfo.class);
- if (udi == null)
- throw new IllegalStateException("Cannot obtain unified deployement
info");
-
- URL warURL = udi.webappURL;
- if (warURL == null)
- throw new IllegalStateException("Cannot obtain webapp URL");
-
- File warFile = new File(warURL.getFile());
- if (warFile.isDirectory() == false)
- throw new WSException("Expected a war directory: " + warURL);
-
- File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
- if (webXML.isFile() == false)
- throw new WSException("Cannot find web.xml: " + webXML);
-
- try
- {
- // After redeployment there might be a stale copy of the original
web.xml.org,
we delete it
- File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
- orgWebXML.delete();
-
- // Rename the web.xml
- if (webXML.renameTo(orgWebXML) == false)
- throw new WSException("Cannot rename web.xml: " + orgWebXML);
-
- FileInputStream stream = new FileInputStream(orgWebXML);
- rewriteWebXml(stream, webXML, udi.classLoader);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception e)
- {
- throw new WSException(e);
- }
- }
-
- public void rewriteWebXml(InputStream source, File dest, ClassLoader loader) throws
Exception
- {
- if (dest == null)
- {
- dest = File.createTempFile("jbossws-alt-web", "xml",
IOUtils.createTempDirectory());
- dest.deleteOnExit();
- }
-
- Element root = DOMUtils.parse(source);
- modifyServletConfig(root, loader);
-
- FileOutputStream fos = new FileOutputStream(dest);
- new DOMWriter(fos).setPrettyprint(true).print(root);
- fos.flush();
- fos.close();
- }
-
- private void modifyServletConfig(Element root, ClassLoader loader) throws
ClassNotFoundException
- {
- Iterator itServlets = DOMUtils.getChildElements(root, "servlet");
- while (itServlets.hasNext())
- {
- Element servletElement = (Element)itServlets.next();
- String linkName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(servletElement,
"servlet-name"));
-
- // find the servlet-class
- Element classElement = DOMUtils.getFirstChildElement(servletElement,
"servlet-class");
-
- // JSP
- if (classElement == null)
- continue;
-
- String servletClassName = DOMUtils.getTextContent(classElement).trim();
-
- // Get the servlet class
- Class servletClass = null;
- if (loader != null)
- {
- try
- {
- servletClass = loader.loadClass(servletClassName);
- }
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- }
- }
-
- String targetBeanName = null;
-
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servletElement))
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- Element elParamValue = DOMUtils.getFirstChildElement(elParam,
"param-value");
- if
(Endpoint.SEPID_DOMAIN_ENDPOINT.equals(DOMUtils.getTextContent(elParamName)))
- {
- targetBeanName = DOMUtils.getTextContent(elParamValue);
- }
- }
- }
- else
- {
- // Check if it is a real servlet that we can ignore
- if (servletClass != null && JavaUtils.isAssignableFrom(Servlet.class,
servletClass))
- {
- log.info("Ignore servlet: " + servletClassName);
- continue;
- }
- else if (servletClassName.endsWith("Servlet"))
- {
- log.info("Ignore <servlet-class> that ends with
'Servlet': " + servletClassName);
- continue;
- }
-
- // build a list of detached elements that come after <servlet-class>
- boolean startDetach = false;
- List<Element> detachedElements = new ArrayList<Element>();
- Iterator itDetached = DOMUtils.getChildElements(servletElement);
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- if (startDetach == true)
- {
- detachedElements.add(el);
- servletElement.removeChild(el);
- }
- if (el.equals(classElement))
- {
- servletElement.removeChild(el);
- startDetach = true;
- }
- }
-
- // replace the class name
- classElement = (Element)DOMUtils.createElement("servlet-class");
- classElement.appendChild(DOMUtils.createTextNode(serviceEndpointServlet));
- classElement =
(Element)servletElement.getOwnerDocument().importNode(classElement, true);
- servletElement.appendChild(classElement);
-
- // add additional init params
- if (servletClassName.equals(serviceEndpointServlet) == false)
- {
- Element paramElement = DOMUtils.createElement("init-param");
-
paramElement.appendChild(DOMUtils.createElement("param-name")).appendChild(DOMUtils.createTextNode(Endpoint.SEPID_DOMAIN_ENDPOINT));
-
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(servletClassName));
- paramElement =
(Element)servletElement.getOwnerDocument().importNode(paramElement, true);
- servletElement.appendChild(paramElement);
- targetBeanName = servletClassName;
- }
-
- // reattach the elements
- itDetached = detachedElements.iterator();
- while (itDetached.hasNext())
- {
- Element el = (Element)itDetached.next();
- servletElement.appendChild(el);
- }
- }
-
- if (targetBeanName == null)
- throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
- }
- }
-
- // Return true if the web.xml is already modified
- private boolean isAlreadyModified(Element servletElement)
- {
- Iterator itParams = DOMUtils.getChildElements(servletElement,
"init-param");
- while (itParams.hasNext())
- {
- Element elParam = (Element)itParams.next();
- Element elParamName = DOMUtils.getFirstChildElement(elParam,
"param-name");
- if
(Endpoint.SEPID_DOMAIN_ENDPOINT.equals(DOMUtils.getTextContent(elParamName)))
- return true;
- }
- return false;
- }
-}
\ No newline at end of file
Modified: trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-04-25
19:29:13 UTC (rev 2924)
@@ -25,6 +25,7 @@
<inject bean="WSAssignEndpointHandlersDeployer"/>
<inject bean="WSModifyWebMetaDataDeployer"/>
<inject bean="WSWSDLPublisherDeployer"/>
+ <inject bean="WSEndpointNameDeployer"/>
<inject bean="WSRegisteringDeployer"/>
</list>
</property>
@@ -39,6 +40,7 @@
<inject bean="WSWebAppGeneratorDeployer"/>
<inject bean="WSWebAppPublishingDeployer"/>
<inject bean="WSWSDLPublisherDeployer"/>
+ <inject bean="WSEndpointNameDeployer"/>
<inject bean="WSRegisteringDeployer"/>
</list>
</property>
@@ -47,7 +49,7 @@
<property name="deployers">
<list class="java.util.LinkedList"
elementClass="org.jboss.ws.integration.deployment.Deployer">
<inject bean="WSClassLoaderInjectionDeployer"/>
- <inject bean="WSInitializeMetaDataDeployer"/>
+ <inject bean="WSMetaDataInitDeployer"/>
<inject bean="WSEndpointLifecycleDeployer"/>
</list>
</property>
@@ -68,22 +70,23 @@
<bean name="WSAssignEndpointMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.AssignEndpointMetaDataDeployer"/>
<bean name="WSClassLoaderInjectionDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.ClassLoaderInjectionDeployer"/>
<bean name="WSEndpointLifecycleDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.EndpointLifecycleDeployer"/>
- <bean name="WSInitializeMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.InitializeMetaDataDeployer"/>
- <bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.ModifyWebMetaDataDeployer"/>
+ <bean name="WSEndpointNameDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.EndpointNameDeployer"/>
+ <bean name="WSMetaDataInitDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.InitializeMetaDataDeployer"/>
+ <bean name="WSModifyWebMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.ModifyWebMetaDataDeployer">
+ <property
name="servletClass">org.jboss.ws.integration.jboss50.jbossws.ServiceEndpointServlet</property>
+ </bean>
<bean name="WSRegisteringDeployer"
class="org.jboss.ws.integration.deployment.RegisteringDeployer"/>
<bean name="WSUnifiedDeploymentInfoDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.UnifiedDeploymentInfoDeployer"/>
<bean name="WSUnifiedMetaDataDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.UnifiedMetaDataDeployer"/>
<bean name="WSValidatingDeployer"
class="org.jboss.ws.integration.deployment.ValidatingDeployer"/>
<bean name="WSWebAppGeneratorDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WebAppGeneratorDeployer"/>
<bean name="WSWebAppPublishingDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WebAppPublishingDeployer">
+ <property name="servletClass"><inject
bean="WSModifyWebMetaDataDeployer"
property="servletClass"/></property>
<property name="mainDeployer"><inject
bean="MainDeployer"/></property>
</bean>
- <bean name="WSWebXMLRewritingDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WebXMLRewritingDeployer">
- <property
name="serviceEndpointServlet">org.jboss.ws.integration.jboss50.jbossws.ServiceEndpointServlet</property>
- </bean>
<bean name="WSWSDLPublisherDeployer"
class="org.jboss.ws.integration.jboss50.jbossws.WSDLPublisherDeployer"/>
- <!-- Register deployers with the Web Service JSE deployer - ->
+ <!-- Register deployers with the Web Service JSE deployer
<bean name="WSJAXRPCDeployerHookJSE"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookJSE">
<property name="deploymentManager"><inject
bean="WSDeploymentJSE"/></property>
<install bean="WebServiceDeployerJSE"
method="addDeployerHook">
@@ -97,10 +100,9 @@
</parameter>
</uninstall>
<depends>WebServiceDeployerJSE</depends>
- </bean>
- -->
-
- <!-- Register deployers with the Web Service JSE deployer - ->
+ </bean-->
+
+ <!-- Register deployers with the Web Service JSE deployer
<bean name="WSJAXRPCDeployerHookEJB21"
class="org.jboss.ws.integration.jboss50.jbossws.JAXRPCDeployerHookEJB21">
<property name="deploymentManager"><inject
bean="WSDeploymentEJB"/></property>
<install bean="WebServiceDeployerEJB"
method="addDeployerHook">
@@ -114,10 +116,9 @@
</parameter>
</uninstall>
<depends>WebServiceDeployerEJB</depends>
- </bean>
- -->
+ </bean-->
- <!-- Register deployers with the Web Service lifecycle deployer - ->
+ <!-- Register deployers with the Web Service lifecycle deployer
<bean name="WSLifecycleDeployerHook"
class="org.jboss.ws.integration.jboss50.jbossws.BasicDeployerHook">
<property name="deploymentManager"><inject
bean="WSLifecycleDeployment"/></property>
<install bean="WebServiceLifecycleDeployer"
method="addDeployerHook">
@@ -131,8 +132,7 @@
</parameter>
</uninstall>
<depends>WebServiceLifecycleDeployer</depends>
- </bean>
- -->
+ </bean-->
<!--
*****************************************************************************************************************************
@@ -177,7 +177,7 @@
<bean name="ServiceEndpointPublisher"
class="org.jboss.ws.integration.jboss50.ServiceEndpointPublisher">
<property name="mainDeployer"><inject
bean="MainDeployer"/></property>
- <property
name="serviceEndpointServlet">org.jboss.ws.integration.jboss50.JBossServiceEndpointServlet</property>
+ <property
name="servletClass">org.jboss.ws.integration.jboss50.JBossServiceEndpointServlet</property>
</bean>
<!-- Bind Service objects in client environment context -->
Modified:
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java
===================================================================
---
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointPublisher.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -77,7 +77,7 @@
public String publishServiceEndpoint(URL warURL) throws Exception
{
- new wspublish().process(warURL, targetDir, getServiceEndpointServlet());
+ new wspublish().process(warURL, targetDir, getServletClass());
return "OK";
}
Modified:
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java
===================================================================
---
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -48,7 +48,7 @@
public static final String DEFAULT_TOMCAT_SERVICE_ENDPOINT_SERVLET =
"org.jboss.ws.integration.tomcat.TomcatServiceEndpointServlet";
- public URL process(URL warURL, File destDir, String servletName) throws IOException
+ public URL process(URL warURL, File destDir, String servletClass) throws IOException
{
if (warURL == null)
throw new IllegalArgumentException("Invalid war URL: " + warURL);
@@ -56,8 +56,8 @@
if (destDir == null || destDir.isDirectory() == false)
throw new IllegalArgumentException("Invalid destintion dir: " +
destDir);
- if (servletName == null)
- servletName = DEFAULT_TOMCAT_SERVICE_ENDPOINT_SERVLET;
+ if (servletClass == null)
+ servletClass = DEFAULT_TOMCAT_SERVICE_ENDPOINT_SERVLET;
InputStream in = warURL.openStream();
String warName = new File(warURL.getFile()).getName();
@@ -73,7 +73,7 @@
udi.classLoader = DeploymentLoader.newInstance(udi.webappURL);
TomcatServiceEndpointPublisher publisher = new TomcatServiceEndpointPublisher();
- publisher.setServiceEndpointServlet(servletName);
+ publisher.setServletClass(servletClass);
publisher.rewriteWebXml(udi);
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -59,7 +59,7 @@
public static final String BEAN_NAME = "ServiceEndpointPublisher";
// The configured service endpoint servlet
- private String servletName;
+ private String servletClass;
// The results of the URL rewriting
public class RewriteResults
@@ -70,14 +70,14 @@
public Map<String, String> sepTargetMap = new HashMap<String,
String>();
}
- public String getServiceEndpointServlet()
+ public String getServletClass()
{
- return servletName;
+ return servletClass;
}
- public void setServiceEndpointServlet(String servletName)
+ public void setServletClass(String servletClass)
{
- this.servletName = servletName;
+ this.servletClass = servletClass;
}
public String publishServiceEndpoint(UnifiedDeploymentInfo udi) throws Exception
@@ -160,19 +160,19 @@
if (classElement == null)
continue;
- String servletClassName = DOMUtils.getTextContent(classElement).trim();
+ String orgServletClassName = DOMUtils.getTextContent(classElement).trim();
// Get the servlet class
- Class servletClass = null;
+ Class orgServletClass = null;
if (loader != null)
{
try
{
- servletClass = loader.loadClass(servletClassName);
+ orgServletClass = loader.loadClass(orgServletClassName);
}
catch (ClassNotFoundException ex)
{
- log.warn("Cannot load servlet class: " + servletClassName);
+ log.warn("Cannot load servlet class: " + orgServletClassName);
}
}
@@ -196,14 +196,14 @@
else
{
// Check if it is a real servlet that we can ignore
- if (servletClass != null && JavaUtils.isAssignableFrom(Servlet.class,
servletClass))
+ if (orgServletClass != null &&
JavaUtils.isAssignableFrom(Servlet.class, orgServletClass))
{
- log.info("Ignore servlet: " + servletClassName);
+ log.info("Ignore servlet: " + orgServletClassName);
continue;
}
- else if (servletClassName.endsWith("Servlet"))
+ else if (orgServletClassName.endsWith("Servlet"))
{
- log.info("Ignore <servlet-class> that ends with
'Servlet': " + servletClassName);
+ log.info("Ignore <servlet-class> that ends with
'Servlet': " + orgServletClassName);
continue;
}
@@ -228,19 +228,19 @@
// replace the class name
classElement = (Element)DOMUtils.createElement("servlet-class");
- classElement.appendChild(DOMUtils.createTextNode(servletName));
+ classElement.appendChild(DOMUtils.createTextNode(servletClass));
classElement =
(Element)servletElement.getOwnerDocument().importNode(classElement, true);
servletElement.appendChild(classElement);
// add additional init params
- if (servletClassName.equals(servletName) == false)
+ if (orgServletClassName.equals(servletClass) == false)
{
Element paramElement = DOMUtils.createElement("init-param");
paramElement.appendChild(DOMUtils.createElement("param-name")).appendChild(DOMUtils.createTextNode(Endpoint.SEPID_DOMAIN_ENDPOINT));
-
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(servletClassName));
+
paramElement.appendChild(DOMUtils.createElement("param-value")).appendChild(DOMUtils.createTextNode(orgServletClassName));
paramElement =
(Element)servletElement.getOwnerDocument().importNode(paramElement, true);
servletElement.appendChild(paramElement);
- targetBeanName = servletClassName;
+ targetBeanName = orgServletClassName;
}
// reattach the elements
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-04-25
14:23:29 UTC (rev 2923)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointGeneratorEJB.java 2007-04-25
19:29:13 UTC (rev 2924)
@@ -117,10 +117,12 @@
Element servlet =
(Element)webApp.appendChild(DOMUtils.createElement("servlet"));
Element servletName =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
servletName.appendChild(DOMUtils.createTextNode(ejbName));
+
Element servletClass =
(Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
- String targetBean = sepMetaData.getServiceEndpointImplName();
- String seiName = sepMetaData.getServiceEndpointInterfaceName();
- String servletClassName = (targetBean != null ? targetBean : seiName);
+ String servletClassName = sepMetaData.getServiceEndpointImplName();
+ if (servletClassName == null)
+ throw new IllegalStateException("Cannot obtain endpoint bean
name");
+
servletClass.appendChild(DOMUtils.createTextNode(servletClassName));
}