From: Scott S. <sco...@jb...> - 2005-05-01 21:07:19
|
User: starksm Date: 05/05/01 17:07:05 Modified: src/main/org/jboss/web/tomcat/tc5 DeployerConfig.java Tomcat5.java Tomcat5MBean.java TomcatDeployer.java Log: Add a filtered packages setting that specifies the names of the packages that should not be loaded from the web app class loaders. Revision Changes Path 1.12 +12 -1 jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/DeployerConfig.java (In the diff below, changes in quantity of whitespace are not shown.) Index: DeployerConfig.java =================================================================== RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/DeployerConfig.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -b -r1.11 -r1.12 --- DeployerConfig.java 16 Sep 2004 01:41:48 -0000 1.11 +++ DeployerConfig.java 1 May 2005 21:07:05 -0000 1.12 @@ -8,7 +8,7 @@ * The tomcat war deployer configuration passed in from the web container. * * @author Sco...@jb... - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ */ public class DeployerConfig { @@ -96,6 +96,8 @@ * The default security-domain name to use */ private String defaultSecurityDomain; + /** Package names that should be ignored for class loading */ + private String[] filteredPackages; /** * Flag indicating whether web-app specific context xmls may set the privileged flag. @@ -316,4 +318,13 @@ { this.secMgrService = mgr; } + + public String[] getFilteredPackages() + { + return filteredPackages; + } + public void setFilteredPackages(String[] filteredPackages) + { + this.filteredPackages = filteredPackages; + } } 1.29 +15 -3 jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Tomcat5.java =================================================================== RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -b -r1.28 -r1.29 --- Tomcat5.java 25 Apr 2005 17:51:16 -0000 1.28 +++ Tomcat5.java 1 May 2005 21:07:05 -0000 1.29 @@ -41,7 +41,7 @@ * @author Costin Manolache * @author Won...@re... * @author Dim...@jb... - * @version $Revision: 1.28 $ + * @version $Revision: 1.29 $ * @see org.jboss.web.AbstractWebContainer */ public class Tomcat5 extends AbstractWebContainer @@ -121,6 +121,8 @@ private boolean allowSelfPrivilegedWebApps = false; /** The service used to flush authentication cache on session invalidation. */ private JaasSecurityManagerServiceMBean secMgrService; + /** */ + private String[] filteredPackages; public Tomcat5() { @@ -309,6 +311,15 @@ this.secMgrService = mgr; } + public String[] getFilteredPackages() + { + return filteredPackages; + } + public void setFilteredPackages(String[] pkgs) + { + this.filteredPackages = pkgs; + } + public void startService() throws Exception { @@ -539,6 +550,7 @@ config.setUseJBossWebLoader(this.useJBossWebLoader); config.setAllowSelfPrivilegedWebApps(this.allowSelfPrivilegedWebApps); config.setSecurityManagerService(this.secMgrService); + config.setFilteredPackages(filteredPackages); deployer.setServer(server); deployer.init(config); return deployer; 1.15 +12 -1 jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Tomcat5MBean.java =================================================================== RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- Tomcat5MBean.java 25 Apr 2005 17:51:16 -0000 1.14 +++ Tomcat5MBean.java 1 May 2005 21:07:05 -0000 1.15 @@ -18,7 +18,7 @@ * * @author Sco...@jb... * @author Costin Manolache - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * @see AbstractWebContainerMBean */ public interface Tomcat5MBean extends AbstractWebContainerMBean @@ -187,4 +187,15 @@ * @param mgr the JaasSecurityManagerServiceMBean */ public void setSecurityManagerService(JaasSecurityManagerServiceMBean mgr); + + /** + * + * @return + */ + public String[] getFilteredPackages(); + /** + * + * @param pkgs + */ + public void setFilteredPackages(String[] pkgs); } 1.39 +25 -16 jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/TomcatDeployer.java (In the diff below, changes in quantity of whitespace are not shown.) Index: TomcatDeployer.java =================================================================== RCS file: /cvsroot/jboss/jboss-tomcat/src/main/org/jboss/web/tomcat/tc5/TomcatDeployer.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -b -r1.38 -r1.39 --- TomcatDeployer.java 1 May 2005 13:12:03 -0000 1.38 +++ TomcatDeployer.java 1 May 2005 21:07:05 -0000 1.39 @@ -1,5 +1,5 @@ /* - * JBoss, the OpenSource WebOS + * JBoss, Home of Professional Open Source * * Distributable under LGPL license. * See terms of license at gnu.org. @@ -7,6 +7,7 @@ package org.jboss.web.tomcat.tc5; import org.apache.catalina.Loader; +import org.apache.catalina.session.StandardManager; import org.jboss.deployment.DeploymentException; import org.jboss.deployment.DeploymentInfo; import org.jboss.metadata.WebMetaData; @@ -46,7 +47,7 @@ * * @author Sco...@jb... * @author Costin Manolache - * @version $Revision: 1.38 $ + * @version $Revision: 1.39 $ */ public class TomcatDeployer extends AbstractWebDeployer { @@ -119,11 +120,18 @@ does not see the war level overrides. The call to setWarURL adds these paths to the deployment UCL. */ - WebCtxLoader webLoader = null; + Loader webLoader = null; if (config.isUseJBossWebLoader()) { - webLoader = new WebCtxLoader(loader); - webLoader.setWarURL(url); + WebCtxLoader jbossLoader = new WebCtxLoader(loader); + jbossLoader.setWarURL(url); + webLoader = jbossLoader; + } + else + { + String[] pkgs = config.getFilteredPackages(); + WebAppLoader jbossLoader = new WebAppLoader(loader, pkgs); + webLoader = jbossLoader; } // We need to establish the JNDI ENC prior to the start @@ -184,11 +192,6 @@ server.setAttribute(objectName, new Attribute ("saveConfig", Boolean.FALSE)); - /* - JBossSecurityMgrRealm jbossRealm = new JBossSecurityMgrRealm(); - jbossRealm.setSubjectAttributeName(config.getSubjectAttributeName()); - server.setAttribute(objectName, new Attribute("realm", jbossRealm)); - */ if (webLoader != null) { server.setAttribute(objectName, new Attribute @@ -284,7 +287,7 @@ AbstractJBossManager manager = null; String managerClassName = config.getManagerClass(); Class managerClass = Thread.currentThread().getContextClassLoader().loadClass(managerClassName); - manager = (AbstractJBossManager)managerClass.newInstance(); + manager = (AbstractJBossManager) managerClass.newInstance(); String name = "//" + ((hostName == null) ? "localhost" : hostName) + ctxPath; manager.init(name, metaData, config.isUseJK(), config.isUseLocalCache()); server.setAttribute(objectName, new Attribute("manager", manager)); @@ -341,6 +344,12 @@ log.error("Failed to setup clustering, clustering disabled"); } } + else + { + StandardManager manager = new StandardManager(); + manager.setPathname(""); + server.setAttribute(objectName, new Attribute("manager", manager)); + } /* Add security association valve after the authorization valves so that the authenticated user may be associated with the @@ -362,7 +371,7 @@ new String[]{"org.apache.catalina.Valve"}); // Retrieve the state, and throw an exception in case of a failure - Integer state = (Integer)server.getAttribute(objectName, "state"); + Integer state = (Integer) server.getAttribute(objectName, "state"); if (state.intValue() != 1) { throw new DeploymentException("URL " + warUrl + " deployment failed"); |