Class SecurityManagerUtils

java.lang.Object
org.jboss.ws.tools.security.legacy.SecurityManagerUtils

public class SecurityManagerUtils extends Object
A helper class that caches and provides status about the SecurityManager API, which is deprecated starting from JDK17 (JEP 411), and removed on JDK 23+ (JEP 486). It also keeps the java.security.* deprecated APIs separate.
  • Constructor Details

    • SecurityManagerUtils

      public SecurityManagerUtils()
  • Method Details

    • isSecurityManagerAvailable

      public static boolean isSecurityManagerAvailable()
      Provides access to the static boolean status flag that tells whether a SecurityManager is installed
    • doPrivilegedGetContextClassLoader

      public static ClassLoader doPrivilegedGetContextClassLoader()
      Helper method to execute privileged action for getting context classloader, using FQN for deprecated/removed APIs, and avoid class loading issues on JDK 23+
    • doPrivilegedGetContextClassLoader

      public static ClassLoader doPrivilegedGetContextClassLoader(Class<?> clazz)
      Helper method to execute privileged action for getting context classloader, using FQN for deprecated/removed APIs, and avoid class loading issues on JDK 23+
    • doPrivilegedSetContextClassLoader

      public static void doPrivilegedSetContextClassLoader(ClassLoader classLoader)
      Helper method to execute privileged action for setting context classloader, using FQN for deprecated/removed APIs, and avoid class loading issues on JDK 23+
    • doPrivilegedLoadClass

      public static Class<?> doPrivilegedLoadClass(ClassLoader cl, String name) throws PrivilegedActionException
      Helper method to execute privileged action for loading a class, using FQN for deprecated/removed APIs, and avoid class loading issues on JDK 23+
      Throws:
      PrivilegedActionException