I have two jar files. One.jar contains main method to start the process and other two.jar contains just class files.
In One.jar I have referenced two.jar in its manifest classpath.
One.jar contains mechanism to dynamically load the classes using Class.forName()
I want to deploy the One.jar only once for lifetime. Will not be making any changes to it.
Changes will be happening only in two.jar
I want to hot swap the two.jar with updated two.jar. I have seen other posts about hot swapping too like OSGi, hotswap for ANT but nothing helps me.
After a little research found out that JRebel does this really better but I really dont know how to integrate it with these jars? I am stuck on this for almost 2 days. Just need few steps of info to get this done. Someone help me please... This is really very important to me... Thanks
Hey all I have finally got a solution for this. I really don't know that I will come up with such a easy solution. I took the idea of @Thorbjørn Ravn Andersen. All I did was first get the timestamp of the jar file and then load the jar using URLClassLoader. If the timestamp of the jar file changes (i.e. when I replace the jar with updated jar) then I am discarding old URLClassLoader object using close() and loading the new jar with URLClassLoader again. The only thing I have to check every time is whether the timestamp of jar changes or not. Hope this answer helps other people too. Thank you all for your support.