org.apache.commons.discovery.jdk
Class JDKHooks

java.lang.Object
  extended by org.apache.commons.discovery.jdk.JDKHooks
Direct Known Subclasses:
JDK11Hooks, JDK12Hooks

public abstract class JDKHooks
extends Object

Author:
Richard A. Sitze

Constructor Summary
protected JDKHooks()
           
 
Method Summary
static JDKHooks getJDKHooks()
          Return singleton object representing JVM hooks/tools.
abstract  Enumeration getResources(ClassLoader loader, String resourceName)
           
abstract  ClassLoader getSystemClassLoader()
          The system class loader is available for JDK 1.2 or later, if certain security conditions are met.
abstract  String getSystemProperty(String propName)
          Get the system property
abstract  ClassLoader getThreadContextClassLoader()
          The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKHooks

protected JDKHooks()
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 String getSystemProperty(String propName)
Get the system property

Parameters:
propName - name of the property
Returns:
value of the property

getThreadContextClassLoader

public abstract 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 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 Enumeration getResources(ClassLoader loader,
                                         String resourceName)
                                  throws IOException
Throws:
IOException


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.