Forums Register Login

choose different version at run-time

+Pie Number of slices to send: Send
I have a dao need to call some 3th Party jar, at firstly I import these class run successfully, But now they have pubished over 2 version, basically these version have the same package and class and both have a interface being support to me, so my problem is I want choose the different version at run-time ON every call. any have good Solutions. i don't want change some existing code.

maybe i have own classloader to load the jar is better, but I have using "import" the needed interface, how to change is impossible using own classloader. meanwhile, any call i need load the jar before run and unload all class which have load to jvm after finised?
+Pie Number of slices to send: Send
Any reason why you don't just use the most recent?
+Pie Number of slices to send: Send
 

Paul Sturrock wrote:Any reason why you don't just use the most recent?



thanks your reply, what is your said the most recent?
+Pie Number of slices to send: Send
I mean use the more recent version of this 3rd party jar file, or is there a specific reason you want your code to use the older version?
+Pie Number of slices to send: Send
 

Paul Sturrock wrote:I mean use the more recent version of this 3rd party jar file, or is there a specific reason you want your code to use the older version?



YES, The recent version of this 3rd party jar is not only instead of older version, So we need choose different version depending input parameter ON VERY CALL.
It's just a flesh wound! Or a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 936 times.
Similar Threads
why different class loaders?
reading a properties file
Use Reflection to "find" classes
Executing different version of same source code
Question of class loaders.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:47:46.