Author: jason.greene(a)jboss.com
Date: 2006-11-16 01:25:04 -0500 (Thu, 16 Nov 2006)
New Revision: 1444
Removed:
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderFactory.java
Modified:
trunk/src/main/resources/jbossws.deployer/META-INF/deployer-beans.xml
Log:
Get rid of old classloader stuff
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderDeployer.java 2006-11-16
03:13:56 UTC (rev 1443)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderDeployer.java 2006-11-16
06:25:04 UTC (rev 1444)
@@ -1,76 +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.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.classloader.ClassLoaderFactory;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.logging.Logger;
-
-/**
- * A deployer that adds a webapp class loader to the depployment unit
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class WebAppClassLoaderDeployer extends AbstractSimpleDeployer
-{
- // The default relative order after the JBossWebAppParsingDeployer
- public int getRelativeOrder()
- {
- return PARSER_DEPLOYER + 2;
- }
-
- @Override
- public void deploy(DeploymentUnit unit) throws DeploymentException
- {
- ClassLoader classLoader = null;
- try
- {
- // This throws a RTE if the loader was not set
- classLoader = unit.getClassLoader();
- }
- catch (Exception ex)
- {
- // ignore
- }
-
-
- if (classLoader == null)
- {
- unit.getDeploymentContext().createClassLoader(new WebAppClassLoaderFactory());
- }
- }
-}
Deleted:
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderFactory.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderFactory.java 2006-11-16
03:13:56 UTC (rev 1443)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/WebAppClassLoaderFactory.java 2006-11-16
06:25:04 UTC (rev 1444)
@@ -1,145 +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.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.jboss.deployers.spi.classloader.ClassLoaderFactory;
-import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.logging.Logger;
-
-/**
- * A class loader factory for web apps
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 31-Oct-2005
- */
-public class WebAppClassLoaderFactory implements ClassLoaderFactory
-{
- // provide logging
- private static Logger log = Logger.getLogger(WebAppClassLoaderFactory.class);
-
- private ClassLoader classLoader;
-
- public ClassLoader createClassLoader(DeploymentContext context) throws Exception
- {
- log.debug("createClassLoader: " + context.getRoot());
-
- ArrayList<URL> list = new ArrayList<URL>();
-
- URL warURL = context.getRoot().toURL();
- String externalForm = warURL.toExternalForm();
-
- if (externalForm.endsWith("!/"))
- {
- String fileName = warURL.getFile();
- if (fileName.indexOf("!/") > 0)
- fileName = fileName.substring(0, fileName.indexOf("!/"));
-
- try
- {
- URL url = new URL(fileName);
- fileName = url.getFile();
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- File warFile = new File(fileName);
- if (warFile.exists())
- {
- // Add root url
- list.add(new URL(externalForm));
-
- ZipFile zipFile = new ZipFile(warFile);
- Enumeration en = zipFile.entries();
- while (en.hasMoreElements())
- {
- ZipEntry entry = (ZipEntry)en.nextElement();
- String entryName = entry.getName();
-
- // Add WEB-INF/classes
- if (entryName.equals("WEB-INF/classes/"))
- {
- URL classesURL = new URL(externalForm + entryName);
- list.add(classesURL);
- }
-
- // Add WEB-INF/lib/*.jar
- if (entryName.startsWith("WEB-INF/lib") &&
entryName.endsWith(".jar"))
- {
- URL jarURL = new URL(externalForm + entryName);
- list.add(jarURL);
- }
- }
- }
- else
- {
- log.warn("WAR file does not exist: " + warFile);
- }
- }
- else
- {
- String path = warURL.getFile();
-
- File classesDir = new File(path, "WEB-INF/classes");
- if (classesDir.exists())
- list.add(classesDir.toURL());
-
- File libDir = new File(path, "WEB-INF/lib");
- if (libDir.exists())
- {
- File[] jars = libDir.listFiles();
- int length = jars != null ? jars.length : 0;
- for (int j = 0; j < length; j++)
- {
- File jar = jars[j];
- if (jar.getAbsolutePath().endsWith(".jar"))
- {
- list.add(jar.toURL());
- }
- }
- }
- }
-
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
- classLoader = new URLClassLoader(list.toArray(new URL[list.size()]), parent);
-
- return classLoader;
- }
-
- public void removeClassLoader(DeploymentContext context) throws Exception
- {
- log.debug("removeClassLoader: " + context.getRoot());
- this.classLoader = null;
- }
-}
Modified: trunk/src/main/resources/jbossws.deployer/META-INF/deployer-beans.xml
===================================================================
--- trunk/src/main/resources/jbossws.deployer/META-INF/deployer-beans.xml 2006-11-16
03:13:56 UTC (rev 1443)
+++ trunk/src/main/resources/jbossws.deployer/META-INF/deployer-beans.xml 2006-11-16
06:25:04 UTC (rev 1444)
@@ -17,21 +17,6 @@
<depends>JBossWebAppParsingDeployer</depends>
</bean>
- <!--
- <bean name="WebAppClassLoaderDeployer"
class="org.jboss.ws.integration.jboss50.WebAppClassLoaderDeployer">
- <install bean="MainDeployer" method="addDeployer">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="MainDeployer" method="removeDeployer">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- </bean>
- -->
-
<bean name="JAXWSDeployerJSE"
class="org.jboss.ws.integration.jboss50.JAXWSDeployerJSE">
<install bean="MainDeployer" method="addDeployer">
<parameter>
@@ -73,4 +58,4 @@
</uninstall>
</bean>
-</deployment>
\ No newline at end of file
+</deployment>