Package org.jboss.shrinkwrap.api
Class SecurityActions
- java.lang.Object
-
- org.jboss.shrinkwrap.api.SecurityActions
-
final class SecurityActions extends java.lang.ObjectA set of privileged actions that are not to leak out of this package- Version:
- $Revision: $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSecurityActions.GetTcclActionSingle instance to get the TCCL
-
Constructor Summary
Constructors Modifier Constructor Description privateSecurityActions()No instantiation
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.ClassLoadergetThreadContextClassLoader()Obtains the Thread Context ClassLoader(package private) static <T> TnewInstance(java.lang.Class<?> clazz, java.lang.Class<?>[] argumentTypes, java.lang.Object[] arguments, java.lang.Class<T> expectedType)Creates a new instance of the specifiedClassusing the specified construction arguments.(package private) static <T> TnewInstance(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.
-
-
-
Method Detail
-
getThreadContextClassLoader
static java.lang.ClassLoader getThreadContextClassLoader()
Obtains the Thread Context ClassLoader
-
getConstructor
static java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> clazz, java.lang.Class<?>... argumentTypes) throws java.lang.NoSuchMethodExceptionObtains the Constructor specified from the given Class and argument types- Parameters:
clazz-argumentTypes-- Returns:
- Throws:
java.lang.NoSuchMethodException
-
newInstance
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 specifiedClassusing the specified construction arguments. Casts and returns as the specified expected type- Type Parameters:
T-- Parameters:
clazz-argumentTypes-arguments-expectedType-- Returns:
-
newInstance
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.- Parameters:
className- Full classname of class to createargumentTypes- The constructor argument typesarguments- The constructor argumentscl- The ClassLoader to use in constructing the new instance- Returns:
- a new instance
- Throws:
java.lang.IllegalArgumentException- if className, argumentTypes, ClassLoader, or arguments are nulljava.lang.RuntimeException- if any exceptions during creation
-
-