title: Priority classloader in Java
body: <p>I want to implement <code>PriorityClassLoader</code> which can do following:</p>
  
  <ul>
  <li>It accepts default <code>ClassLoader</code> instance as a constructor parameter</li>
  <li>It has <code>addURL</code> method which work like <code>addURL</code> in <code>URLClassLoader</code>, but for each new URL it set the priority.</li>
  </ul>
  
  <p>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?</p>
  
  <p><em>PS</em> - 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.</p>