public abstract class ClassPathManager extends Object
Some details vary among releases of the Java runtime This abstract class and its concrete implementation subclasses isolate those dependencies.
Modifier and Type | Field and Description |
---|---|
static String |
PERSISTENCE_JAR_CLASSES |
Modifier | Constructor and Description |
---|---|
protected |
ClassPathManager(ClassLoader loader,
boolean keepJWSClassLoader)
Returns a new instance of the manager.
|
Modifier and Type | Method and Description |
---|---|
protected String |
classNameToResourceName(String className)
Converts a class name to a resource name.
|
abstract File |
findContainingJar(URL resourceURL) |
static ClassPathManager |
getClassPathManager(boolean keepJWSClassLoader)
Returns the appropriate type of ClassPathManager.
|
protected ClassLoader |
getJnlpClassLoader() |
protected ClassLoader |
getJNLPClassLoader()
Returns the Java Web Start-provided class loader recorded when the
class path manager was created.
|
abstract ClassLoader |
getParentClassLoader()
Returns the appropriate parent class loader for the ACC.
|
protected boolean |
keepJWSClassLoader() |
URI |
locateClass(String className)
Locates the URI for the JAR containing the specified class
|
URL[] |
locateDownloadedJars()
Reports URLs for the locally-cached copies of the JARs downloaded by
Java Web Start needed for the ACC's class path and policy settings.
|
URL[] |
locateJARs(String classNamesString) |
URL[] |
locatePersistenceJARs() |
protected URL |
locateResource(String resourceName)
Finds a resource using the class's class loader.
|
public static final String PERSISTENCE_JAR_CLASSES
protected ClassPathManager(ClassLoader loader, boolean keepJWSClassLoader)
loader
- the class loader provided by Java Web Startpublic static ClassPathManager getClassPathManager(boolean keepJWSClassLoader)
protected boolean keepJWSClassLoader()
protected ClassLoader getJnlpClassLoader()
public URI locateClass(String className) throws IllegalAccessException, InvocationTargetException, MalformedURLException, URISyntaxException, ClassNotFoundException
className
- the name of the class to be locatedIllegalAccessException
InvocationTargetException
MalformedURLException
URISyntaxException
ClassNotFoundException
public abstract ClassLoader getParentClassLoader()
public abstract File findContainingJar(URL resourceURL) throws IllegalArgumentException, URISyntaxException, MalformedURLException, IllegalAccessException, InvocationTargetException
protected ClassLoader getJNLPClassLoader()
protected String classNameToResourceName(String className)
className
- the name of the class of interest in x.y.z formatprotected URL locateResource(String resourceName)
resourceName
- the class to findpublic URL[] locateDownloadedJars() throws ClassNotFoundException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, MalformedURLException
ClassNotFoundException
URISyntaxException
NoSuchMethodException
IllegalAccessException
InvocationTargetException
MalformedURLException
public URL[] locateJARs(String classNamesString) throws IllegalAccessException, InvocationTargetException, MalformedURLException, URISyntaxException, ClassNotFoundException
public URL[] locatePersistenceJARs() throws IllegalAccessException, InvocationTargetException, MalformedURLException, URISyntaxException, ClassNotFoundException
Copyright © 2021. All rights reserved.