Hi, my last sugestion on how to enhance the scoped loader repository stuff does not seems to have been welcomed into JBoss. However it would be verry nice if it was possible to extends LoaderRespoitory and EARDeployer outside of the jboss package hierarkies. This is not possible now due to some protected signatures in jboss.mx.loading and the way the EARDeployer is written. Some fairly small changes would however make it possible to define your own repository strategies. Here are the diffs to do it. Is these changes possible to get into the 3.0 line or would they distrupt any current funktionality that I do not understand (security wise for example):
diff -ur jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/HeirarchicalLoaderRepository3.java jboss-3.0/jmx/src/main/org/jboss/mx/loading/HeirarchicalLoaderRepository3.java --- jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/HeirarchicalLoaderRepository3.java Thu Oct 31 09:31:31 2002 +++ jboss-3.0/jmx/src/main/org/jboss/mx/loading/HeirarchicalLoaderRepository3.java Fri Feb 21 15:07:57 2003 @@ -133,7 +133,7 @@ * first to this repository and then the parent repository. [EMAIL PROTECTED] the cached class if found, null otherwise */ - Class loadClassFromCache(String name) + public Class loadClassFromCache(String name) { // Try this repository Class foundClass = super.loadClassFromCache(name); diff -ur jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/LoadMgr.java jboss-3.0/jmx/src/main/org/jboss/mx/loading/LoadMgr.java --- jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/LoadMgr.java Sat Feb 1 19:24:57 2003 +++ jboss-3.0/jmx/src/main/org/jboss/mx/loading/LoadMgr.java Fri Feb 21 15:11:29 2003 @@ -49,15 +49,15 @@ * populate the repository cache and be assigned as the UCL.loadClass * return value. */ - static class PkgClassLoader + public static class PkgClassLoader { - UnifiedClassLoader3 ucl; - int order; - PkgClassLoader(UnifiedClassLoader3 ucl) + public UnifiedClassLoader3 ucl; + public int order; + public PkgClassLoader(UnifiedClassLoader3 ucl) { this(ucl, Integer.MAX_VALUE); } - PkgClassLoader(UnifiedClassLoader3 ucl, int order) + public PkgClassLoader(UnifiedClassLoader3 ucl, int order) { this.ucl = ucl; this.order = order; diff -ur jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java jboss-3.0/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java --- jboss-3.0-orig/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java Sat Jan 11 10:24:53 2003 +++ jboss-3.0/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java Fri Feb 21 15:00:15 2003 @@ -171,7 +171,7 @@ * @param name the fully qualified class name * @return the cached Class if found, null otherwise */ - Class loadClassFromCache(String name) + public Class loadClassFromCache(String name) { Class cls = null; synchronized( classes ) diff -ur jboss-3.0-orig/server/src/main/org/jboss/deployment/EARDeployer.java jboss-3.0/server/src/main/org/jboss/deployment/EARDeployer.java --- jboss-3.0-orig/server/src/main/org/jboss/deployment/EARDeployer.java Sun Jan 12 21:04:16 2003 +++ jboss-3.0/server/src/main/org/jboss/deployment/EARDeployer.java Fri Feb 21 15:24:05 2003 @@ -115,17 +115,8 @@ metaData.importXml(jbossApp, true); // Check for a loader-repository for scoping Element loader = MetaData.getOptionalChild(jbossApp, "loader-repository"); - String repositoryName = MetaData.getOptionalChildContent(jbossApp, "loader-repository"); - if( repositoryName != null ) - { - // Check for an implementation class - String repositoryClassName = loader.getAttribute("loaderRepositoryClass"); - if( repositoryClassName.length() == 0 ) - repositoryClassName = null; - // Get the required object name of the repository - ObjectName objectName = new ObjectName(repositoryName); - di.setRepositoryInfo(repositoryClassName, objectName); - } + initLoaderRepository(di,loader); + } // resolve the watch @@ -276,5 +267,25 @@ return name == null ? new ObjectName(OBJECT_NAME + this.name) : name; } + /** + * Set up a loader repository if specifyed. Override in subclass for + * any extra treatmeant. + */ + protected void initLoaderRepository(DeploymentInfo di, Element loader) throws Exception { + if ( loader==null) + return; + + String repositoryName = MetaData.getElementContent(loader); + if( repositoryName != null ) + { + // Check for an implementation class + String repositoryClassName = loader.getAttribute("loaderRepositoryClass"); + if( repositoryClassName.length() == 0 ) + repositoryClassName = null; + // Get the required object name of the repository + ObjectName objectName = new ObjectName(repositoryName); + di.setRepositoryInfo(repositoryClassName, objectName); + } + } // Private ------------------------------------------------------- } //Peter -- ------------------------------------------------------------ Peter Antman Chief Technology Officer, Development Technology in Media, Box 34105 100 26 Stockholm WWW: http://www.tim.se WWW: http://www.backsource.org Email: [EMAIL PROTECTED] Phone: +46-(0)8-506 381 11 Mobile: +46-(0)704 20 58 11 ------------------------------------------------------------ ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development