all classes are loaded by a classloader, by creating your own classloader
you can nullify it after use and the class will have to load from disk
again, included is a example of a custom classloader, here is an example of
how to use it:



SimpleClassLoader sc = new SimpleClassLoader( "/opt/java/classes" );
try {
        somecoolclass cool =
(somecoolclass)(sc.loadClass( "somecoolclass.class" )).newInstance();
        cooo.doCoolThings();
        }
catch (Exception e) {
        System.out.println( "aarrgggghhhh, classloader failed = " +
e.getMessage() );
        e.printStackTrace();
        }
sc = null;



so you will have to wrap the functionality you want to be dynamicaly
reloaded in the somecoolclass.class and create a generator wrapper that uses
the classloader to load your class and then kill the classloader at the end
of each execution run.


mvh karl oie



-----Original Message-----
From: Martin Kavalar [mailto:[EMAIL PROTECTED]]
Sent: 19. oktober 2001 16:50
To: Cocoon Mailing List
Subject: Reloading Cocoon2 / Custom Generator


Hello,
i was wondering if it is possible to reload cocoon or a custom build
generator after its been recompiled without restarting tomcat. If yes,
i'd like to know how, and if not, then id like to know if theres another
way to speed up the compiling / testing process somehow because always
waiting about 30 seconds (restarting tomcat, reloading cocoon..) after
changing the java code slows down my dev. cycle quite a bit.
Tanks a lot, if you can help, you make my life easiert ;)
martin


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

SimpleClassLoader.java

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to