Class SecurityActions

java.lang.Object
org.jboss.shrinkwrap.api.SecurityActions

final class SecurityActions extends Object
A set of privileged actions that are not to leak out of this package
Version:
$Revision: $
  • Constructor Details

    • SecurityActions

      private SecurityActions()
      No instantiation
  • Method Details

    • getThreadContextClassLoader

      static ClassLoader getThreadContextClassLoader()
      Obtains the Thread Context ClassLoader
    • getConstructor

      static Constructor<?> getConstructor(Class<?> clazz, Class<?>... argumentTypes) throws NoSuchMethodException
      Obtains the Constructor specified from the given Class and argument types
      Parameters:
      clazz -
      argumentTypes -
      Returns:
      Throws:
      NoSuchMethodException
    • newInstance

      static <T> T newInstance(Class<?> clazz, Class<?>[] argumentTypes, Object[] arguments, Class<T> expectedType)
      Creates a new instance of the specified Class using 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(String className, Class<?>[] argumentTypes, Object[] arguments, Class<T> expectedType, 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 create
      argumentTypes - The constructor argument types
      arguments - The constructor arguments
      cl - The ClassLoader to use in constructing the new instance
      Returns:
      a new instance
      Throws:
      IllegalArgumentException - if className, argumentTypes, ClassLoader, or arguments are null
      RuntimeException - if any exceptions during creation