Author: thomas.diesler(a)jboss.com
Date: 2007-03-10 11:33:51 -0500 (Sat, 10 Mar 2007)
New Revision: 2579
Added:
branches/jbossws-1.2.0/integration-tomcat/src/java/
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/jbossws-1.2.0/integration-tomcat/src/resources/
Removed:
branches/jbossws-1.2.0/integration-jboss40/src/main/
branches/jbossws-1.2.0/integration-jboss42/src/main/
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
branches/jbossws-1.2.0/integration-tomcat/src/main/
Modified:
branches/jbossws-1.2.0/integration-jboss40/build.xml
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java
branches/jbossws-1.2.0/integration-jboss40/src/resources/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-1.2.0/integration-tomcat/src/resources/jbossws.war/META-INF/jboss-beans.xml
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
Log:
Fix jboss40 integration
Modified: branches/jbossws-1.2.0/integration-jboss40/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-03-10 16:32:44 UTC (rev
2578)
+++ branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-03-10 16:33:51 UTC (rev
2579)
@@ -66,8 +66,6 @@
<exclude
name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
<exclude
name="org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java"/>
<exclude
name="org/jboss/ws/integration/jboss42/ServiceEndpointInvokerEJB3.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceRefHandlerMBean.java"/>
- <exclude
name="org/jboss/ws/integration/jboss42/ServiceRefHandler.java"/>
<classpath refid="jboss40.integration.classpath"/>
<classpath path="${core.output.classes14.dir}"/>
<classpath path="${core.output.classes.dir}"/>
Modified:
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java 2007-03-10
16:32:44 UTC (rev 2578)
+++
branches/jbossws-1.2.0/integration-jboss40/src/java/org/jboss/ws/integration/jboss40/ServiceRefMetaDataAdaptor.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -24,6 +24,7 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.Properties;
@@ -109,7 +110,9 @@
usrmd.setConfigName(srmd.getConfigName());
usrmd.setConfigFile(srmd.getConfigFile());
- usrmd.setWsdlOverride(srmd.getWsdlOverride().toExternalForm());
+ URL wsdlOverride = srmd.getWsdlOverride();
+ if (wsdlOverride != null)
+ usrmd.setWsdlOverride(wsdlOverride.toExternalForm());
Properties callProps = srmd.getCallProperties();
if (callProps != null)
Modified:
branches/jbossws-1.2.0/integration-jboss40/src/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
branches/jbossws-1.2.0/integration-jboss40/src/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-03-10
16:32:44 UTC (rev 2578)
+++
branches/jbossws-1.2.0/integration-jboss40/src/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-03-10
16:33:51 UTC (rev 2579)
@@ -4,7 +4,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="KernelLocator"
class="org.jboss.ws.core.server.KernelLocator">
+ <bean name="KernelLocator"
class="org.jboss.ws.integration.KernelLocator">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
Copied: branches/jbossws-1.2.0/integration-tomcat/src/java (from rev 2575,
branches/jbossws-1.2.0/integration-tomcat/src/main/java)
Deleted:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2007-03-09
15:00:04 UTC (rev 2575)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -1,206 +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.tomcat;
-
-// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
-import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
-import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
-import org.w3c.dom.Element;
-
-/**
- * Build container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class DeploymentInfoAdaptor
-{
- public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
URLClassLoader loader, ServletContext ctx)
- {
- URL warURL = null;
- try
- {
- warURL = new File(ctx.getRealPath("/")).toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
-
- String contextRoot = getContextRoot(warURL);
-
- udi.vfRoot = new ResourceLoaderAdapter(loader);
- udi.name = contextRoot;
- udi.simpleName = contextRoot.substring(1) + ".war";
- udi.url = warURL;
- udi.metaData = buildWebMetaData(udi, ctx);
- udi.classLoader = loader;
-
- return udi;
- }
-
- private static UnifiedWebMetaData buildWebMetaData(UnifiedDeploymentInfo udi,
ServletContext ctx)
- {
- Element webXML = getWebXMLDocument(ctx);
-
- UnifiedWebMetaData wmd = new UnifiedWebMetaData();
- wmd.setServletMappings(getServetMappings(webXML));
- wmd.setServletClassNames(getServetClassMap(webXML));
- wmd.setContextRoot(getContextRoot(udi.url));
- wmd.setConfigName(ctx.getInitParameter("jbossws-config-name"));
- wmd.setConfigFile(ctx.getInitParameter("jbossws-config-file"));
- wmd.setSecurityMetaData(getSecurityMetaData(webXML));
-
- return wmd;
- }
-
- private static String getContextRoot(URL warURL)
- {
- String contextRoot = warURL.toExternalForm();
- if (contextRoot.endsWith("/"))
- {
- contextRoot = contextRoot.substring(0, contextRoot.length() - 1);
- }
- contextRoot = contextRoot.substring(contextRoot.lastIndexOf("/"));
- if (contextRoot.endsWith(".war"))
- {
- contextRoot = contextRoot.substring(0, contextRoot.length() - 4);
- }
- return contextRoot;
- }
-
- private static Map<String, String> getServetMappings(Element root)
- {
- Map<String, String> servletMappings = new HashMap<String, String>();
-
- Iterator itMapping = DOMUtils.getChildElements(root, "servlet-mapping");
- while (itMapping.hasNext())
- {
- Element smel = (Element)itMapping.next();
- String servletName = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(smel,
"servlet-name"));
- String urlPattern = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(smel,
"url-pattern"));
- servletMappings.put(servletName, urlPattern);
- }
-
- return servletMappings;
- }
-
- private static Map<String, String> getServetClassMap(Element root)
- {
- Map<String, String> servletClassMap = new HashMap<String, String>();
-
- Iterator itServlet = DOMUtils.getChildElements(root, "servlet");
- while (itServlet.hasNext())
- {
- Element sel = (Element)itServlet.next();
- String servletName = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(sel,
"servlet-name"));
-
- Iterator itParams = DOMUtils.getChildElements(sel, "init-param");
- while (itParams.hasNext())
- {
- Element ipel = (Element)itParams.next();
- String paramName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(ipel, "param-name"));
- String paramValue =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(ipel, "param-value"));
- if
(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(paramName))
- {
- servletClassMap.put(servletName, paramValue);
- }
- }
- }
-
- return servletClassMap;
- }
-
- private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Element root)
- {
- ArrayList<UnifiedWebSecurityMetaData> securityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
-
- Iterator itSecurityConstraint = DOMUtils.getChildElements(root,
"security-constraint");
- while (itSecurityConstraint.hasNext())
- {
- UnifiedWebSecurityMetaData uwsmd = new UnifiedWebSecurityMetaData();
- securityMetaData.add(uwsmd);
-
- Element securityConstraint = (Element)itSecurityConstraint.next();
-
- Iterator itWebResCol = DOMUtils.getChildElements(securityConstraint,
"web-resource-collection");
- while (itWebResCol.hasNext())
- {
- Element webResCol = (Element)itWebResCol.next();
- String webResName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(webResCol,
"web-resource-name"));
- UnifiedWebResourceCollection uwrc = uwsmd.addWebResource(webResName);
-
- Iterator itUrlPatters = DOMUtils.getChildElements(webResCol,
"url-pattern");
- while (itUrlPatters.hasNext())
- {
- Element urlPattern = (Element)itUrlPatters.next();
- uwrc.addPattern(DOMUtils.getTextContent(urlPattern));
- }
- }
-
- Element userData = DOMUtils.getFirstChildElement(securityConstraint,
"user-data-constraint");
- if (userData != null)
- {
- String transportGuarantee =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(userData,
"transport-guarantee"));
- uwsmd.setTransportGuarantee(transportGuarantee);
- }
-
- }
-
- return securityMetaData;
- }
-
- private static Element getWebXMLDocument(ServletContext ctx)
- {
- URL webXML = null;
- try
- {
- webXML = new File(ctx.getRealPath("/WEB-INF/web.xml")).toURL();
- return DOMUtils.parse(webXML.openStream());
- }
- catch (IOException e)
- {
- throw new WSException("Cannot parse: " + webXML);
- }
- }
-
-}
Copied:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
(from rev 2577,
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java)
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
(rev 0)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -0,0 +1,206 @@
+/*
+ * 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.tomcat;
+
+// $Id: WebServiceDeploymentAdaptor.java 317 2006-05-14 17:16:59Z
thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
+import
org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
+import org.w3c.dom.Element;
+
+/**
+ * Build container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class DeploymentInfoAdaptor
+{
+ public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
URLClassLoader loader, ServletContext ctx)
+ {
+ URL warURL = null;
+ try
+ {
+ warURL = new File(ctx.getRealPath("/")).toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+
+ String contextRoot = getContextRoot(warURL);
+
+ udi.vfRoot = new ResourceLoaderAdapter(loader);
+ udi.name = contextRoot;
+ udi.simpleName = contextRoot.substring(1) + ".war";
+ udi.url = warURL;
+ udi.metaData = buildWebMetaData(udi, ctx);
+ udi.classLoader = loader;
+
+ return udi;
+ }
+
+ private static UnifiedWebMetaData buildWebMetaData(UnifiedDeploymentInfo udi,
ServletContext ctx)
+ {
+ Element webXML = getWebXMLDocument(ctx);
+
+ UnifiedWebMetaData wmd = new UnifiedWebMetaData();
+ wmd.setServletMappings(getServetMappings(webXML));
+ wmd.setServletClassNames(getServetClassMap(webXML));
+ wmd.setContextRoot(getContextRoot(udi.url));
+ wmd.setConfigName(ctx.getInitParameter("jbossws-config-name"));
+ wmd.setConfigFile(ctx.getInitParameter("jbossws-config-file"));
+ wmd.setSecurityMetaData(getSecurityMetaData(webXML));
+
+ return wmd;
+ }
+
+ private static String getContextRoot(URL warURL)
+ {
+ String contextRoot = warURL.toExternalForm();
+ if (contextRoot.endsWith("/"))
+ {
+ contextRoot = contextRoot.substring(0, contextRoot.length() - 1);
+ }
+ contextRoot = contextRoot.substring(contextRoot.lastIndexOf("/"));
+ if (contextRoot.endsWith(".war"))
+ {
+ contextRoot = contextRoot.substring(0, contextRoot.length() - 4);
+ }
+ return contextRoot;
+ }
+
+ private static Map<String, String> getServetMappings(Element root)
+ {
+ Map<String, String> servletMappings = new HashMap<String, String>();
+
+ Iterator itMapping = DOMUtils.getChildElements(root, "servlet-mapping");
+ while (itMapping.hasNext())
+ {
+ Element smel = (Element)itMapping.next();
+ String servletName = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(smel,
"servlet-name"));
+ String urlPattern = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(smel,
"url-pattern"));
+ servletMappings.put(servletName, urlPattern);
+ }
+
+ return servletMappings;
+ }
+
+ private static Map<String, String> getServetClassMap(Element root)
+ {
+ Map<String, String> servletClassMap = new HashMap<String, String>();
+
+ Iterator itServlet = DOMUtils.getChildElements(root, "servlet");
+ while (itServlet.hasNext())
+ {
+ Element sel = (Element)itServlet.next();
+ String servletName = DOMUtils.getTextContent(DOMUtils.getFirstChildElement(sel,
"servlet-name"));
+
+ Iterator itParams = DOMUtils.getChildElements(sel, "init-param");
+ while (itParams.hasNext())
+ {
+ Element ipel = (Element)itParams.next();
+ String paramName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(ipel, "param-name"));
+ String paramValue =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(ipel, "param-value"));
+ if
(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL.equals(paramName))
+ {
+ servletClassMap.put(servletName, paramValue);
+ }
+ }
+ }
+
+ return servletClassMap;
+ }
+
+ private static List<UnifiedWebSecurityMetaData> getSecurityMetaData(final
Element root)
+ {
+ ArrayList<UnifiedWebSecurityMetaData> securityMetaData = new
ArrayList<UnifiedWebSecurityMetaData>();
+
+ Iterator itSecurityConstraint = DOMUtils.getChildElements(root,
"security-constraint");
+ while (itSecurityConstraint.hasNext())
+ {
+ UnifiedWebSecurityMetaData uwsmd = new UnifiedWebSecurityMetaData();
+ securityMetaData.add(uwsmd);
+
+ Element securityConstraint = (Element)itSecurityConstraint.next();
+
+ Iterator itWebResCol = DOMUtils.getChildElements(securityConstraint,
"web-resource-collection");
+ while (itWebResCol.hasNext())
+ {
+ Element webResCol = (Element)itWebResCol.next();
+ String webResName =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(webResCol,
"web-resource-name"));
+ UnifiedWebResourceCollection uwrc = uwsmd.addWebResource(webResName);
+
+ Iterator itUrlPatters = DOMUtils.getChildElements(webResCol,
"url-pattern");
+ while (itUrlPatters.hasNext())
+ {
+ Element urlPattern = (Element)itUrlPatters.next();
+ uwrc.addPattern(DOMUtils.getTextContent(urlPattern));
+ }
+ }
+
+ Element userData = DOMUtils.getFirstChildElement(securityConstraint,
"user-data-constraint");
+ if (userData != null)
+ {
+ String transportGuarantee =
DOMUtils.getTextContent(DOMUtils.getFirstChildElement(userData,
"transport-guarantee"));
+ uwsmd.setTransportGuarantee(transportGuarantee);
+ }
+
+ }
+
+ return securityMetaData;
+ }
+
+ private static Element getWebXMLDocument(ServletContext ctx)
+ {
+ URL webXML = null;
+ try
+ {
+ webXML = new File(ctx.getRealPath("/WEB-INF/web.xml")).toURL();
+ return DOMUtils.parse(webXML.openStream());
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot parse: " + webXML);
+ }
+ }
+
+}
Deleted:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-03-09
15:00:04 UTC (rev 2575)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -1,218 +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.tomcat;
-
-// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URLClassLoader;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.kernel.spi.registry.KernelRegistry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
-import org.jboss.ws.core.server.JAXWSDeployment;
-import org.jboss.ws.core.server.ServiceEndpointDeployer;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.integration.KernelLocator;
-import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
-import org.jboss.ws.metadata.umdm.ResourceLoaderAdapter;
-
-/**
- * A servlet that is installed for every web service endpoint.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-May-2006
- */
-public class TomcatServiceEndpointServlet extends AbstractServiceEndpointServlet
-{
- // provide logging
- private static final Logger log =
Logger.getLogger(TomcatServiceEndpointServlet.class);
-
- public void init(ServletConfig config) throws ServletException
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- CrossContextLoader jbwsLoader =
CrossContextLoader.newInstance(config.getServletContext());
- Thread.currentThread().setContextClassLoader(jbwsLoader);
-
- super.init(config);
- deployServiceEndpoints(getServletContext());
- }
- catch (Exception ex)
- {
- String message = "Failed to initialze service endpoint";
- log.error(message, ex);
- WSException.rethrow(message, ex);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- public void destroy()
- {
- undeployServiceEndpoints(getServletContext());
- super.destroy();
- }
-
- public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- if ((ctxLoader instanceof CrossContextLoader) == false)
- {
- CrossContextLoader jbwsLoader =
CrossContextLoader.newInstance(getServletContext());
- Thread.currentThread().setContextClassLoader(jbwsLoader);
- }
- super.service(req, res);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- /**
- * Bootstrap the Microkernel and initialize the
- * ServiceEndpointManager
- */
- protected void initServiceEndpointManager()
- {
- String jbosswsPath = getServletContext().getRealPath("/") +
"../jbossws";
- File jbosswsDir = new File(jbosswsPath);
- if (jbosswsDir.exists() == false || jbosswsDir.isDirectory() == false)
- throw new IllegalStateException("Cannot find expanded dir: " +
jbosswsDir);
-
- File beansFile = new File(jbosswsPath + "/META-INF/jboss-beans.xml");
- if (beansFile.exists() == false)
- throw new IllegalStateException("Cannot find jboss-beans.xml at: " +
beansFile);
-
- try
- {
- new KernelBootstrap().bootstrap(beansFile.toURL());
- }
- catch (Exception ex)
- {
- String message = "Failed to bootstrap kernel";
- log.error(message, ex);
- throw new WSException(message, ex);
- }
-
- // init the service endpoint manager
- super.initServiceEndpointManager();
- }
-
- private void deployServiceEndpoints(ServletContext servletContext)
- {
- UnifiedDeploymentInfo udi =
(UnifiedDeploymentInfo)servletContext.getAttribute(UnifiedDeploymentInfo.class.getName());
- if (udi == null)
- {
- ServiceEndpointDeployer deployer = getServiceEndpointDeployer();
- try
- {
- udi = createDeploymentInfo(servletContext);
- servletContext.setAttribute(UnifiedDeploymentInfo.class.getName(), udi);
-
- deployer.create(udi);
- deployer.start(udi);
- }
- catch (Throwable th)
- {
- String message = "Failed to deploy service endpoint";
- log.error(message);
- throw new WSException(message, th);
- }
- }
- }
-
- private UnifiedDeploymentInfo createDeploymentInfo(ServletContext servletContext)
throws Exception
- {
- UnifiedDeploymentInfo udi;
-
- URLClassLoader ctxLoader =
(URLClassLoader)Thread.currentThread().getContextClassLoader();
- UnifiedVirtualFile vfsWebservices = getWebservicesFile(ctxLoader);
- if (vfsWebservices != null)
- {
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
- }
- else
- {
- udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
- }
-
- DeploymentInfoAdaptor.buildDeploymentInfo(udi, ctxLoader, servletContext);
- return udi;
- }
-
- protected UnifiedVirtualFile getWebservicesFile(URLClassLoader ctxLoader)
- {
- UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(ctxLoader);
- try
- {
- return vfsRoot.findChild("WEB-INF/webservices.xml");
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
-
- private void undeployServiceEndpoints(ServletContext servletContext)
- {
- UnifiedDeploymentInfo udi =
(UnifiedDeploymentInfo)servletContext.getAttribute(UnifiedDeploymentInfo.class.getName());
- if (udi != null)
- {
- ServiceEndpointDeployer deployer = getServiceEndpointDeployer();
- try
- {
- deployer.stop(udi);
- deployer.destroy(udi);
- }
- catch (Throwable th)
- {
- String message = "Failed to undeploy service endpoint";
- log.error(message);
- }
- }
- }
-
- private ServiceEndpointDeployer getServiceEndpointDeployer()
- {
- KernelRegistry registry = KernelLocator.getKernel().getRegistry();
- KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
- return (ServiceEndpointDeployer)entry.getTarget();
- }
-}
Copied:
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
(from rev 2577,
branches/jbossws-1.2.0/integration-tomcat/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java)
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
(rev 0)
+++
branches/jbossws-1.2.0/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -0,0 +1,218 @@
+/*
+ * 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.tomcat;
+
+// $Id: ServiceEndpointServlet.java 296 2006-05-08 19:45:49Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URLClassLoader;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
+import org.jboss.ws.core.server.JAXWSDeployment;
+import org.jboss.ws.core.server.ServiceEndpointDeployer;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.integration.KernelLocator;
+import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+
+/**
+ * A servlet that is installed for every web service endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public class TomcatServiceEndpointServlet extends AbstractServiceEndpointServlet
+{
+ // provide logging
+ private static final Logger log =
Logger.getLogger(TomcatServiceEndpointServlet.class);
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ CrossContextLoader jbwsLoader =
CrossContextLoader.newInstance(config.getServletContext());
+ Thread.currentThread().setContextClassLoader(jbwsLoader);
+
+ super.init(config);
+ deployServiceEndpoints(getServletContext());
+ }
+ catch (Exception ex)
+ {
+ String message = "Failed to initialze service endpoint";
+ log.error(message, ex);
+ WSException.rethrow(message, ex);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void destroy()
+ {
+ undeployServiceEndpoints(getServletContext());
+ super.destroy();
+ }
+
+ public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ if ((ctxLoader instanceof CrossContextLoader) == false)
+ {
+ CrossContextLoader jbwsLoader =
CrossContextLoader.newInstance(getServletContext());
+ Thread.currentThread().setContextClassLoader(jbwsLoader);
+ }
+ super.service(req, res);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ /**
+ * Bootstrap the Microkernel and initialize the
+ * ServiceEndpointManager
+ */
+ protected void initServiceEndpointManager()
+ {
+ String jbosswsPath = getServletContext().getRealPath("/") +
"../jbossws";
+ File jbosswsDir = new File(jbosswsPath);
+ if (jbosswsDir.exists() == false || jbosswsDir.isDirectory() == false)
+ throw new IllegalStateException("Cannot find expanded dir: " +
jbosswsDir);
+
+ File beansFile = new File(jbosswsPath + "/META-INF/jboss-beans.xml");
+ if (beansFile.exists() == false)
+ throw new IllegalStateException("Cannot find jboss-beans.xml at: " +
beansFile);
+
+ try
+ {
+ new KernelBootstrap().bootstrap(beansFile.toURL());
+ }
+ catch (Exception ex)
+ {
+ String message = "Failed to bootstrap kernel";
+ log.error(message, ex);
+ throw new WSException(message, ex);
+ }
+
+ // init the service endpoint manager
+ super.initServiceEndpointManager();
+ }
+
+ private void deployServiceEndpoints(ServletContext servletContext)
+ {
+ UnifiedDeploymentInfo udi =
(UnifiedDeploymentInfo)servletContext.getAttribute(UnifiedDeploymentInfo.class.getName());
+ if (udi == null)
+ {
+ ServiceEndpointDeployer deployer = getServiceEndpointDeployer();
+ try
+ {
+ udi = createDeploymentInfo(servletContext);
+ servletContext.setAttribute(UnifiedDeploymentInfo.class.getName(), udi);
+
+ deployer.create(udi);
+ deployer.start(udi);
+ }
+ catch (Throwable th)
+ {
+ String message = "Failed to deploy service endpoint";
+ log.error(message);
+ throw new WSException(message, th);
+ }
+ }
+ }
+
+ private UnifiedDeploymentInfo createDeploymentInfo(ServletContext servletContext)
throws Exception
+ {
+ UnifiedDeploymentInfo udi;
+
+ URLClassLoader ctxLoader =
(URLClassLoader)Thread.currentThread().getContextClassLoader();
+ UnifiedVirtualFile vfsWebservices = getWebservicesFile(ctxLoader);
+ if (vfsWebservices != null)
+ {
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
vfsWebservices);
+ }
+ else
+ {
+ udi = new JAXWSDeployment(UnifiedDeploymentInfo.DeploymentType.JAXWS_JSE);
+ }
+
+ DeploymentInfoAdaptor.buildDeploymentInfo(udi, ctxLoader, servletContext);
+ return udi;
+ }
+
+ protected UnifiedVirtualFile getWebservicesFile(URLClassLoader ctxLoader)
+ {
+ UnifiedVirtualFile vfsRoot = new ResourceLoaderAdapter(ctxLoader);
+ try
+ {
+ return vfsRoot.findChild("WEB-INF/webservices.xml");
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+
+
+ private void undeployServiceEndpoints(ServletContext servletContext)
+ {
+ UnifiedDeploymentInfo udi =
(UnifiedDeploymentInfo)servletContext.getAttribute(UnifiedDeploymentInfo.class.getName());
+ if (udi != null)
+ {
+ ServiceEndpointDeployer deployer = getServiceEndpointDeployer();
+ try
+ {
+ deployer.stop(udi);
+ deployer.destroy(udi);
+ }
+ catch (Throwable th)
+ {
+ String message = "Failed to undeploy service endpoint";
+ log.error(message);
+ }
+ }
+ }
+
+ private ServiceEndpointDeployer getServiceEndpointDeployer()
+ {
+ KernelRegistry registry = KernelLocator.getKernel().getRegistry();
+ KernelRegistryEntry entry = registry.getEntry(ServiceEndpointDeployer.BEAN_NAME);
+ return (ServiceEndpointDeployer)entry.getTarget();
+ }
+}
Copied: branches/jbossws-1.2.0/integration-tomcat/src/resources (from rev 2575,
branches/jbossws-1.2.0/integration-tomcat/src/main/resources)
Modified:
branches/jbossws-1.2.0/integration-tomcat/src/resources/jbossws.war/META-INF/jboss-beans.xml
===================================================================
---
branches/jbossws-1.2.0/integration-tomcat/src/main/resources/jbossws.war/META-INF/jboss-beans.xml 2007-03-09
15:00:04 UTC (rev 2575)
+++
branches/jbossws-1.2.0/integration-tomcat/src/resources/jbossws.war/META-INF/jboss-beans.xml 2007-03-10
16:33:51 UTC (rev 2579)
@@ -4,7 +4,7 @@
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
- <bean name="KernelLocator"
class="org.jboss.ws.core.server.KernelLocator">
+ <bean name="KernelLocator"
class="org.jboss.ws.integration.KernelLocator">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
Modified:
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-03-10
16:32:44 UTC (rev 2578)
+++
branches/jbossws-1.2.0/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-03-10
16:33:51 UTC (rev 2579)
@@ -59,7 +59,7 @@
// The optional transport guarantee
private String transportGuarantee;
// The optional secure wsdl access
- private boolean secureWSDLAccess = true;
+ private boolean secureWSDLAccess;
// The bean that registers with the ServiceEndpointManager
private String managedEndpointBean =
"org.jboss.ws.core.server.ServiceEndpoint";