Package com.sun.enterprise.loader
Class ResourceLocator
java.lang.Object
com.sun.enterprise.loader.ResourceLocator
This class covers the resource loading rules of GlassFish.
- Some resources can be overriden by the application (ie. services)
- Some applications may use the
delegateattribute to prioritize their classloader over server's own resources.
- Author:
- David Matejcek
-
Constructor Summary
ConstructorsConstructorDescriptionResourceLocator(URLClassLoader classLoader, ClassLoader delegate, boolean prioritizeDelegate) -
Method Summary
Modifier and TypeMethodDescriptiongetResources(String name) Finds resources with the given name and returns enumeration providing their locations.booleanisOverridableResource(String name)
-
Constructor Details
-
ResourceLocator
public ResourceLocator(URLClassLoader classLoader, ClassLoader delegate, boolean prioritizeDelegate) - Parameters:
classLoader- - current classloader useddelegate- - delegate classloader, usually parent or system classloaderprioritizeDelegate- - 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
- Parameters:
name-- Returns:
- true if the resource present in the current classloader can shadow parent's resource.
-
getResources
Finds resources with the given name and returns enumeration providing their locations.- Parameters:
name-- Returns:
EnumerationofURLs- Throws:
IOException
-