cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r406990 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
Date Tue, 16 May 2006 17:07:50 GMT
Author: reinhard
Date: Tue May 16 10:07:49 2006
New Revision: 406990

URL: http://svn.apache.org/viewcvs?rev=406990&view=rev
Log:
remove dependency on wiring.xml

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java?rev=406990&r1=406989&r2=406990&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java Tue May
16 10:07:49 2006
@@ -492,52 +492,10 @@
     }
 
     /**
-     * Create the classloader that inlcudes all the [block]/BLOCK-INF/classes directories.

+     * Create the classloader 
      * @throws Exception
      */
     protected void createClassloader() throws Exception {
-        // get the wiring
-        final SourceResolver resolver = this.createSourceResolver(this.log);    
-        Source wiringSource = null;
-        final Configuration wiring;
-        try {
-            wiringSource = resolver.resolveURI(Constants.WIRING);
-            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
-            wiring = builder.build( wiringSource.getInputStream() );            
-        } catch(org.apache.excalibur.source.SourceNotFoundException snfe) {
-            throw new WiringNotFoundException("wiring.xml not found in the root directory
of your Cocoon application.");
-        } finally {
-            resolver.release(wiringSource);
-        }
-        
-        // get all wired blocks and add their classed directory to the classloader
-        List urlList = new ArrayList();        
-        Configuration[] blocks = wiring.getChildren("block");
-        for(int i = 0; i < blocks.length; i++) {
-            String location = blocks[i].getAttribute("location");
-            if(this.log.isDebugEnabled()) {
-                this.log.debug("Found block " + blocks[i].getAttribute("id") + " at " + location);
-            }
-            Source classesDir = null;
-            try {
-               classesDir = resolver.resolveURI(location + "/" + Constants.BLOCK_META_DIR
+ "/classes");
-               if(classesDir.exists()) {
-                   String classesDirURI = classesDir.getURI();
-                   urlList.add(new URL(classesDirURI));
-                   if(this.log.isDebugEnabled()) {
-                       this.log.debug("added " + classesDir.getURI());
-                   }
-               }               
-            } finally {
-                resolver.release(classesDir);
-            }
-        }
-    
-        // setup the classloader using the current classloader as parent
-        ClassLoader parentClassloader = Thread.currentThread().getContextClassLoader();
-        URL[] urls = (URL[]) urlList.toArray(new URL[urlList.size()]);        
-        URLClassLoader classloader = new URLClassLoader(urls, parentClassloader);
-        Thread.currentThread().setContextClassLoader(classloader);
         this.classloader = Thread.currentThread().getContextClassLoader();
     }
 



Mime
View raw message