Package org.apache.commons.discovery.jdk
Class JDKHooks
- java.lang.Object
-
- org.apache.commons.discovery.jdk.JDKHooks
-
- Direct Known Subclasses:
JDK11Hooks,JDK12Hooks
public abstract class JDKHooks extends java.lang.Object- Author:
- Richard A. Sitze
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJDKHooks()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static JDKHooksgetJDKHooks()Return singleton object representing JVM hooks/tools.abstract java.util.EnumerationgetResources(java.lang.ClassLoader loader, java.lang.String resourceName)abstract java.lang.ClassLoadergetSystemClassLoader()The system class loader is available for JDK 1.2 or later, if certain security conditions are met.abstract java.lang.StringgetSystemProperty(java.lang.String propName)Get the system propertyabstract java.lang.ClassLoadergetThreadContextClassLoader()The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met.
-
-
-
Method Detail
-
getJDKHooks
public static final JDKHooks getJDKHooks()
Return singleton object representing JVM hooks/tools. TODO: add logic to detect JDK level.
-
getSystemProperty
public abstract java.lang.String getSystemProperty(java.lang.String propName)
Get the system property- Parameters:
propName- name of the property- Returns:
- value of the property
-
getThreadContextClassLoader
public abstract java.lang.ClassLoader getThreadContextClassLoader()
The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met.- Returns:
- The thread context class loader, if available. Otherwise return null.
-
getSystemClassLoader
public abstract java.lang.ClassLoader getSystemClassLoader()
The system class loader is available for JDK 1.2 or later, if certain security conditions are met.- Returns:
- The system class loader, if available. Otherwise return null.
-
getResources
public abstract java.util.Enumeration getResources(java.lang.ClassLoader loader, java.lang.String resourceName) throws java.io.IOException- Throws:
java.io.IOException
-
-