[jboss-cvs] JBossAS SVN: r102572 - in trunk: component-matrix and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 18 13:47:24 EDT 2010
Author: remy.maucherat at jboss.com
Date: 2010-03-18 13:47:23 -0400 (Thu, 18 Mar 2010)
New Revision: 102572
Removed:
trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppClassLoader.java
trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppLoader.java
Modified:
trunk/build/build-web.xml
trunk/component-matrix/pom.xml
Log:
- New web build.
Modified: trunk/build/build-web.xml
===================================================================
--- trunk/build/build-web.xml 2010-03-18 17:26:20 UTC (rev 102571)
+++ trunk/build/build-web.xml 2010-03-18 17:47:23 UTC (rev 102572)
@@ -114,6 +114,8 @@
<exclude name="common/lib/jboss-ejb3_1.jar" />
<exclude name="common/lib/jboss-ejb3-cache.jar" />
<exclude name="common/lib/jboss-ejb3-common.jar" />
+ <exclude name="common/lib/jboss-ejb3-context-base.jar" />
+ <exclude name="common/lib/jboss-ejb3-context-naming.jar" />
<exclude name="common/lib/jboss-ejb3-deployers.jar" />
<exclude name="common/lib/jboss-ejb3-endpoint.jar" />
<exclude name="common/lib/jboss-ejb3-ext-api-impl.jar" />
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2010-03-18 17:26:20 UTC (rev 102571)
+++ trunk/component-matrix/pom.xml 2010-03-18 17:47:23 UTC (rev 102572)
@@ -49,7 +49,7 @@
<version.jboss.jbossws-spi>1.3.0.Beta4</version.jboss.jbossws-spi>
<version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
<version.hornetq>2.1.0.r8931</version.hornetq>
- <version.jboss.web>3.0.0-beta-2</version.jboss.web>
+ <version.jboss.web>3.0.0-beta-3</version.jboss.web>
<version.jgroups>2.6.13.GA</version.jgroups>
<version.jsr181.api>1.0-MR1</version.jsr181.api>
<version.junit>3.8.2</version.junit>
Deleted: trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppClassLoader.java
===================================================================
--- trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppClassLoader.java 2010-03-18 17:26:20 UTC (rev 102571)
+++ trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppClassLoader.java 2010-03-18 17:47:23 UTC (rev 102572)
@@ -1,185 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.web.tomcat.service;
-
-import java.net.URL;
-
-import org.apache.catalina.loader.WebappClassLoader;
-import org.jboss.logging.Logger;
-import org.jboss.proxy.compiler.IIOPStubCompiler;
-
-/**
- * Subclass the tomcat web app class loader to override the filter method to
- * exclude classes which cannot be override by the web app due to their use in
- * the tomcat web container/integration.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class WebAppClassLoader extends WebappClassLoader
-{
- static Logger log = Logger.getLogger(WebAppClassLoader.class);
-
- private String[] filteredPackages =
- {"org.apache.commons.logging"};
-
- public WebAppClassLoader()
- {
- }
-
- public WebAppClassLoader(ClassLoader parent)
- {
- super(parent);
- }
-
- public String[] getFilteredPackages()
- {
- return filteredPackages;
- }
-
- public void setFilteredPackages(String[] pkgs)
- {
- this.filteredPackages = pkgs;
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.catalina.loader.WebappClassLoader#addURL(java.net.URL)
- */
- @Override
- public void addURL(URL url)
- {
- super.addURL(url);
- }
-
- @Override
- public URL[] getURLs()
- {
- return new URL[0]; // Optimize away the Memory Allocation
- }
-
- /*
- * (non-Javadoc)
- * @see org.apache.catalina.loader.WebappClassLoader#findClass(java.lang.String)
- */
- @Override
- public Class findClass(String name) throws ClassNotFoundException
- {
- boolean trace = log.isTraceEnabled();
- if (trace)
- log.trace("findClass(" + name + ") called");
-
- try
- {
- return super.findClass(name);
- }
- catch (ClassNotFoundException cnfe)
- {
- // try to dynamically generate the class if it is a stub
- int start = name.lastIndexOf('.') + 1;
- if (name.charAt(start) == '_' && name.endsWith("_Stub"))
- return generateStub(name);
- throw cnfe;
- }
- }
-
- /**
- * <p>
- * Generate iiop stubs dynamically for any name ending in _Stub.
- * </p>
- *
- * @param name a <code>String</code> representing the stub fully-qualified class name.
- * @return the <code>Class</code> of the generated stub.
- * @throws ClassNotFoundException if the stub class could not be created.
- */
- private Class generateStub(String name) throws ClassNotFoundException
- {
- boolean trace = log.isTraceEnabled();
- int start = name.lastIndexOf('.') + 1;
- String pkg = name.substring(0, start);
- String interfaceName = pkg + name.substring(start + 1, name.length() - 5);
-
- // This is a workaround for a problem in the RMI/IIOP
- // stub loading code in SUN JDK 1.4.x, which prepends
- // "org.omg.stub." to classes in certain name spaces,
- // such as "com.sun". This non-compliant behavior
- // results in failures when deploying SUN example code,
- // including ECPerf and PetStore, so we remove the prefix.
- if (interfaceName.startsWith("org.omg.stub.com.sun."))
- interfaceName = interfaceName.substring(13);
-
- Class intf = super.loadClass(interfaceName);
- if (trace)
- log.trace("loaded class " + interfaceName);
-
- byte[] code = IIOPStubCompiler.compile(intf, name);
- if (trace)
- log.trace("compiled stub class for " + interfaceName);
-
- Class clz = super.defineClass(name, code, 0, code.length);
- if (trace)
- log.trace("defined stub class for " + interfaceName);
-
- super.resolveClass(clz);
- try
- {
- clz.newInstance();
- }
- catch (Throwable t)
- {
- ClassNotFoundException cnfe = new ClassNotFoundException(interfaceName, t);
- throw cnfe;
- }
- if (trace)
- log.trace("resolved stub class for " + interfaceName);
- return clz;
- }
-
- /**
- * Overriden to filter out classes in the packages listed in the
- * filteredPackages settings.
- *
- * @param name
- * @return true if the class should be loaded from the parent class loader,
- * false if it can be loaded from this class loader.
- */
- protected boolean filter(String name)
- {
- boolean excludeClass = super.filter(name);
- if (excludeClass == false)
- {
- // Check class against our filtered packages
- int length = filteredPackages != null ? filteredPackages.length : 0;
- for (int n = 0; n < length; n++)
- {
- String pkg = filteredPackages[n];
- if (name.startsWith(pkg))
- {
- excludeClass = true;
- break;
- }
- }
- }
- log.trace("filter name=" + name + ", exclude=" + excludeClass);
- return excludeClass;
- }
-}
Deleted: trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppLoader.java
===================================================================
--- trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppLoader.java 2010-03-18 17:26:20 UTC (rev 102571)
+++ trunk/tomcat/src/main/java/org/jboss/web/tomcat/service/WebAppLoader.java 2010-03-18 17:47:23 UTC (rev 102572)
@@ -1,119 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.web.tomcat.service;
-
-import java.net.URL;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.loader.WebappLoader;
-import org.jboss.logging.Logger;
-
-/**
- * Override the tomcat WebappLoader to set the default class loader to the
- * WebAppClassLoader and pass the filtered packages to the WebAppClassLoader.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class WebAppLoader extends WebappLoader
-{
- private static final Logger log = Logger.getLogger(WebAppLoader.class);
-
- private String[] filteredPackages = {
- "org.apache.commons.logging"
- };
- private List<URL> classpath;
-
- private TomcatInjectionContainer injectionContainer;
-
- public WebAppLoader()
- {
- super();
- setLoaderClass(WebAppClassLoader.class.getName());
- }
-
- public WebAppLoader(ClassLoader parent, Set<String> filteredPackages)
- {
- this(parent, filteredPackages, null);
- }
- public WebAppLoader(ClassLoader parent, Set<String> filteredPackages, TomcatInjectionContainer container)
- {
- super(parent);
- setLoaderClass(WebAppClassLoader.class.getName());
- if(filteredPackages != null)
- {
- this.filteredPackages = new String[filteredPackages.size()];
- filteredPackages.toArray(this.filteredPackages);
- }
- injectionContainer = container;
- }
- public WebAppLoader(ClassLoader parent, String[] filteredPackages, TomcatInjectionContainer container)
- {
- super(parent);
- setLoaderClass(WebAppClassLoader.class.getName());
- this.filteredPackages = filteredPackages;
- injectionContainer = container;
- }
-
- /**
- * Use an explicit classpath
- *
- * @param classpath
- */
- public void setClasspath(List<URL> classpath)
- {
- this.classpath = classpath;
- }
-
- /**
- * Override to apply the filteredPackages to the jboss WebAppClassLoader
- *
- * @throws LifecycleException
- */
- public void start() throws LifecycleException
- {
- super.start();
- ClassLoader loader = getClassLoader();
- if (loader instanceof WebAppClassLoader)
- {
- WebAppClassLoader webLoader = (WebAppClassLoader) loader;
- webLoader.setFilteredPackages(filteredPackages);
- if( classpath != null )
- {
- for(URL url : classpath)
- {
- webLoader.addURL(url);
- }
- }
- }
- if (injectionContainer != null)
- {
- log.debug("injectionContainer enabled and processing beginning with Tomcat WebAppLoader");
- // we need to do this because the classloader is initialize by the web container and
- // the injection container needs the classloader so that it can build up Injectors and ENC populators
- injectionContainer.setClassLoader(getClassLoader());
- injectionContainer.processMetadata();
- }
- }
-}
More information about the jboss-cvs-commits
mailing list