|
-
August 5th, 1999, 12:53 AM
#1
Class Loading
Hi,
When I am running a Java app and instaniate the obj of class A, in the
middle of the process, I change the class A and re-compile. How can I make
the Java app to pick up the new class A without terminate and restart the
JVM?
thks, wayne
-
August 5th, 1999, 02:18 AM
#2
Re: Class Loading
I don't think there is any way for this. Actually I'm also looking for something like this.
But as far as my knowledge is concerned, jvm doesn't read the classes after loading them first time.
If u find some method for this, I will also be interested!
- UnicMan
http://members.tripod.com/unicman
-
August 5th, 1999, 03:03 AM
#3
Re: Class Loading
For this case, you have to write your own classloader which extends the ClassLoader class. In your classloader override the method loadClass(..).
In the loadClass(..) method, get the class name and read the contents of the class into a byte array by getting a inputstream for the class. After that use the defineClass(..) method to convert your byte array into a Class object and then use that class object to get the new instance.
I hope this will work but I haven't tried this.
regards,
arun...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|