org.apache.tomcat.util.compat
Class Jdk11Compat

java.lang.Object
  extended byorg.apache.tomcat.util.compat.Jdk11Compat
Direct Known Subclasses:
Jdk12Support

public class Jdk11Compat
extends java.lang.Object

General-purpose utility to provide backward-compatibility and JDK independence. This allow use of JDK1.2 ( or higher ) facilities if available, while maintaining the code compatible with older VMs. The goal is to make backward-compatiblity reasonably easy. The base class supports JDK1.1 behavior.


Field Summary
static java.lang.String JAVA_1_0
           
static java.lang.String JAVA_1_1
           
static java.lang.String JAVA_1_2
           
static java.lang.String JAVA_1_3
           
static java.lang.String JAVA_1_4
           
 
Constructor Summary
Jdk11Compat()
           
 
Method Summary
 java.lang.Object doPrivileged(Action action, java.lang.Object acc)
          Do a priviledged action.
 java.lang.Object getAccessControlContext()
           
 java.util.ResourceBundle getBundle(java.lang.String name, java.util.Locale loc, java.lang.ClassLoader cl)
           
 java.lang.ClassLoader getContextClassLoader()
          Get the context class loader, if java2.
static java.lang.String getJavaVersion()
          Return java version as a string
static Jdk11Compat getJdkCompat()
          Get a compatibiliy helper class.
 java.lang.ClassLoader getParentLoader(java.lang.ClassLoader cl)
           
 java.net.URL[] getURLs(java.lang.ClassLoader cl, int depth)
           
 java.lang.Object getX509Certificates(byte[] x509)
           
static boolean isJava2()
           
 java.lang.ClassLoader newClassLoaderInstance(java.net.URL[] urls, java.lang.ClassLoader parent)
          Return a class loader.
 void refreshPolicy()
           
 void setContextClassLoader(java.lang.ClassLoader cl)
          Set the context class loader - if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_1_0

public static final java.lang.String JAVA_1_0
See Also:
Constant Field Values

JAVA_1_1

public static final java.lang.String JAVA_1_1
See Also:
Constant Field Values

JAVA_1_2

public static final java.lang.String JAVA_1_2
See Also:
Constant Field Values

JAVA_1_3

public static final java.lang.String JAVA_1_3
See Also:
Constant Field Values

JAVA_1_4

public static final java.lang.String JAVA_1_4
See Also:
Constant Field Values
Constructor Detail

Jdk11Compat

public Jdk11Compat()
Method Detail

getJavaVersion

public static java.lang.String getJavaVersion()
Return java version as a string


isJava2

public static boolean isJava2()

newClassLoaderInstance

public java.lang.ClassLoader newClassLoaderInstance(java.net.URL[] urls,
                                                    java.lang.ClassLoader parent)
Return a class loader. For JDK1.2+ will return a URLClassLoader. For JDK1.1 will return a substitute ( util.SimpleClassLoader )


getAccessControlContext

public java.lang.Object getAccessControlContext()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

doPrivileged

public java.lang.Object doPrivileged(Action action,
                                     java.lang.Object acc)
                              throws java.lang.Exception
Do a priviledged action. For java2 a wrapper will be provided and the AccesscController will be called.

Throws:
java.lang.Exception

setContextClassLoader

public void setContextClassLoader(java.lang.ClassLoader cl)
Set the context class loader - if possible.


refreshPolicy

public void refreshPolicy()

getContextClassLoader

public java.lang.ClassLoader getContextClassLoader()
Get the context class loader, if java2.


getParentLoader

public java.lang.ClassLoader getParentLoader(java.lang.ClassLoader cl)

getURLs

public java.net.URL[] getURLs(java.lang.ClassLoader cl,
                              int depth)

getBundle

public java.util.ResourceBundle getBundle(java.lang.String name,
                                          java.util.Locale loc,
                                          java.lang.ClassLoader cl)

getX509Certificates

public java.lang.Object getX509Certificates(byte[] x509)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getJdkCompat

public static Jdk11Compat getJdkCompat()
Get a compatibiliy helper class.



Copyright ? 2001 Apache Software Foundation. All Rights Reserved.