1 7 8 package org.jboss.web.tomcat.tc5; 9 10 import org.apache.catalina.loader.WebappLoader; 11 import org.apache.catalina.LifecycleException; 12 13 20 public class WebAppLoader extends WebappLoader 21 { 22 private String [] filteredPackages = { 23 "org.apache.commons.logging" 24 }; 25 26 public WebAppLoader() 27 { 28 super(); 29 setLoaderClass(WebAppClassLoader.class.getName()); 30 } 31 32 public WebAppLoader(ClassLoader parent, String [] filteredPackages) 33 { 34 super(parent); 35 setLoaderClass(WebAppClassLoader.class.getName()); 36 this.filteredPackages = filteredPackages; 37 } 38 39 44 public void start() throws LifecycleException 45 { 46 super.start(); 47 ClassLoader loader = getClassLoader(); 48 if( loader instanceof WebAppClassLoader ) 49 { 50 WebAppClassLoader webLoader = (WebAppClassLoader) loader; 51 webLoader.setFilteredPackages(filteredPackages); 52 } 53 } 54 } 55 | Popular Tags |