Class ResourceLocator

java.lang.Object
com.sun.enterprise.loader.ResourceLocator

public class ResourceLocator extends Object
This class covers the resource loading rules of GlassFish.
  • Some resources can be overriden by the application (ie. services)
  • Some applications may use the delegate attribute to prioritize their classloader over server's own resources.
Author:
David Matejcek
  • Constructor Details

    • ResourceLocator

      public ResourceLocator(URLClassLoader classLoader, ClassLoader delegate, boolean prioritizeDelegate)
      Parameters:
      classLoader - - current classloader used
      delegate - - delegate classloader, usually parent or system classloader
      prioritizeDelegate - - true if the delegate should be used first. This rule is not applied for explicitly named resources which not only have higher priority than delegate's but they do override them. If they are present in current classloader, the delegate is then not used.
  • Method Details

    • isOverridableResource

      public boolean isOverridableResource(String name)
      Parameters:
      name -
      Returns:
      true if the resource present in the current classloader can shadow parent's resource.
    • getResources

      public Enumeration<URL> getResources(String name) throws IOException
      Finds resources with the given name and returns enumeration providing their locations.
      Parameters:
      name -
      Returns:
      Enumeration of URLs
      Throws:
      IOException