RE: Reloading Cocoon2 / Custom Generator
i am not sure if the SimpleClassLoader can load from jars, but if it can it could work, the classloader is the object that actually gets classes from disk to the jvm, so if the SimpleClassLoader can load the classes from a jar, then it should work. please tell me if you can find a Classloader that can load from jars, i would be thankful! mvh karl -Original Message- From: Martin Kavalar [mailto:[EMAIL PROTECTED]] Sent: 20. oktober 2001 03:11 To: [EMAIL PROTECTED] Subject: Re: Reloading Cocoon2 / Custom Generator I have a jar with all the classes my generator employs in it. Is there no way to get cocoon to reload every class that has changed from disk in this jar? Karl Oie wrote: 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( aarr, 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] - 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] - 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] - 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]
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]
RE: Reloading Cocoon2 / Custom Generator
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( aarr, 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]
Re: Reloading Cocoon2 / Custom Generator
I have a jar with all the classes my generator employs in it. Is there no way to get cocoon to reload every class that has changed from disk in this jar? Karl Oie wrote: 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( aarr, 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] - 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] - 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]