« Return to Thread: Dynamic Class Reloading

Re: Dynamic Class Reloading

by Peter B. Kessler :: Rate this Message:

Reply to Author | View in Thread

Andrew Wiley wrote:
> I'm fairly new to OpenJDK, and I'm wondering if there's any way to reload a
> class while an application is in operation. There's JavaRebel and Apache JCI
> to do this with the Sun JDK, but I don't know if there's an equivalent for
> OpenJDK.
> I have a server application that I want to be able to update without
> rebooting it. I would like to at least be able to reload classes when the
> signature doesn't change. These would be classes on the classpath that are
> used normally (directly, not through reflection) in the application. Is this
> possible?

If you can describe the part you want to reload as an interface, you can change the implementation behind the interface at any time by having your own classloader.  Nothing JDK-specific is required, nor is anything needed beyond what's already in the JVM.

                        ... peter

 « Return to Thread: Dynamic Class Reloading