final class SecurityActions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
SecurityActions.GetTcclAction
Single instance to get the TCCL
|
Modifier | Constructor and Description |
---|---|
private |
SecurityActions()
No instantiation
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.reflect.Constructor<?> |
getConstructor(java.lang.Class<?> clazz,
java.lang.Class<?>... argumentTypes)
Obtains the Constructor specified from the given Class and argument types
|
(package private) static java.lang.ClassLoader |
getThreadContextClassLoader()
Obtains the Thread Context ClassLoader
|
(package private) static <T> T |
newInstance(java.lang.Class<?> clazz,
java.lang.Class<?>[] argumentTypes,
java.lang.Object[] arguments,
java.lang.Class<T> expectedType)
Creates a new instance of the specified
Class using the specified construction arguments. |
(package private) static <T> T |
newInstance(java.lang.String className,
java.lang.Class<?>[] argumentTypes,
java.lang.Object[] arguments,
java.lang.Class<T> expectedType,
java.lang.ClassLoader cl)
Create a new instance by finding a constructor that matches the argumentTypes signature using the arguments for
instantiation.
|
static java.lang.ClassLoader getThreadContextClassLoader()
static java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> clazz, java.lang.Class<?>... argumentTypes) throws java.lang.NoSuchMethodException
clazz
- argumentTypes
- java.lang.NoSuchMethodException
static <T> T newInstance(java.lang.Class<?> clazz, java.lang.Class<?>[] argumentTypes, java.lang.Object[] arguments, java.lang.Class<T> expectedType)
Class
using the specified construction arguments. Casts and
returns as the specified expected typeT
- clazz
- argumentTypes
- arguments
- expectedType
- static <T> T newInstance(java.lang.String className, java.lang.Class<?>[] argumentTypes, java.lang.Object[] arguments, java.lang.Class<T> expectedType, java.lang.ClassLoader cl)
className
- Full classname of class to createargumentTypes
- The constructor argument typesarguments
- The constructor argumentscl
- The ClassLoader to use in constructing the new instancejava.lang.IllegalArgumentException
- if className, argumentTypes, ClassLoader, or arguments are nulljava.lang.RuntimeException
- if any exceptions during creation