Class SecurityActions


  • final class SecurityActions
    extends java.lang.Object
    A 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 class  SecurityActions.GetTcclAction
      Single instance to get the TCCL
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SecurityActions()
      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.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SecurityActions

        private SecurityActions()
        No 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.NoSuchMethodException
        Obtains 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 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​(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 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:
        java.lang.IllegalArgumentException - if className, argumentTypes, ClassLoader, or arguments are null
        java.lang.RuntimeException - if any exceptions during creation