I want to implement PriorityClassLoader
which can do following:
- It accepts default
ClassLoader
instance as a constructor parameter - It has
addURL
method which work likeaddURL
inURLClassLoader
, but for each new URL it set the priority.
When the class should be loaded, loader first will try to load it with default classloader, if not - from the provided URLs according to the priority. Is there any ready solutions?
PS - my original problem was following - I wanted to add URL to the system classloader, but it began to fail on the duplicate classes in system classloader and remote JAR.