I am novice in OSGI technology. Idea of dynamic adding modules to working program seems very attractive for me. I know that OSGI uses own classloader per bundle. As I understand due to
this we have "hot deploy". But I have misunderstanding how this works.
I want to to understand how this technology works. Therefore I want to write own "hot deployer" with hot .class file replace.
For example in my mind was born following idea:
Write application with 2 threads:
first thread outputes some messsage (old message)in the eternal cycle
In second thread we wait some time then replace .class file of class which outputes old message. now our thread1 outputes new message. not necessarily that new message outputes immediately after execution of second thread. I know that we cannot unload class force.
I just want to see that it is possible to write custom "hot deployer".
I cannot find information in google which can helps me.
Please help me realize my idea.
P.S.
I really have not enough information for where can I search information and how to realize. I have read all answers - but I am not able to realize it.
P.S. I know that familiar issue was resolved in jsp and servlets. Specification obliges hot replace jsp without server restart. But I know that jsp ultimately compiles to .class file.