Reputation: 2143
I have a third party jar that connects to a server and executes command and returns result. But this jar connects to only one server in a single instance of JVM.
So how can i execute a Object of a class in a new JVM instance get the results/ exception back in invoker JVM instance.
Upvotes: 0
Views: 336
Reputation: 6726
Try reflection get to at any non-final state to change the server. Class instances are unique per classloader, so you could load the third-party class in a new custom classloader for each server to connect to.
http://www.google.com/search?q=java%20custom%20classloader
Upvotes: 1
Reputation: 100133
You will have to reverse-engineer the protocol between the client lib and the server. tcpmon might help you. A debugger might help you. A profiler might help you as you can see what sort of methods get called.
Upvotes: 0