Author: pier Date: Mon Nov 1 07:24:59 2004 New Revision: 56243 Modified: cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/startup/Main.java Log: More clarification on how static factories work
Modified: cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/startup/Main.java ============================================================================== --- cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/startup/Main.java (original) +++ cocoon/whiteboard/kernel/src/org/apache/cocoon/kernel/startup/Main.java Mon Nov 1 07:24:59 2004 @@ -19,6 +19,17 @@ /** * <p>A simple class initializing a [EMAIL PROTECTED] Kernel} from a the command line.</p> + * + * <p>Note, to properly allow static factories distributed with the [EMAIL PROTECTED] Kernel} + * to be instantiated and returned to the individual blocks, it is <b>strongly + * suggested</b> that this [EMAIL PROTECTED] Main} class and its enclosing JAR archive are + * loaded as an <i>endorsed class</i>.</p> + * + * <p>The <i>system property</i> <code>java.endorsed.dirs</code> controls what code + * is loaded as an endorsed class. To specify this on the command line, use the + * following syntax:</p> + * + * <p><code>java -Djava.endorsed.dirs=<i>directory</i> ...</code></p> * * @author <a href="mailto:[EMAIL PROTECTED]">Pier Fumagalli</a> * @author Copyright © 2000-2004 <a href="http://www.apache.org/">The Apache @@ -71,9 +82,10 @@ ConfigurationBuilder.parse(args[0])); /* Create and initialize a new deployer */ + Thread.currentThread().setContextClassLoader(Main.class.getClassLoader()); Deployer deployer = new Deployer(); deployer.initialize(descriptors, instances); - + /* Add the shutdown hook */ Runtime.getRuntime().addShutdownHook(new Thread(new Main(deployer)));
