Class Java23Subject
- java.lang.Object
-
- org.apache.jackrabbit.oak.commons.jdkcompat.Java23Subject
-
public class Java23Subject extends Object
This class contains methods replacing the deprecatedSubject.getSubject(AccessControlContext)
and associated methods, which changed their behavior with Java 23 (@see https://inside.java/2024/07/08/quality-heads-up).
-
-
Constructor Summary
Constructors Constructor Description Java23Subject()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
doAs(Subject subject, PrivilegedAction<T> action)
static <T> T
doAs(Subject subject, PrivilegedExceptionAction<T> action)
static <T> T
doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext acc)
static <T> T
doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext acc)
static Subject
getSubject()
-
-
-
Method Detail
-
getSubject
public static Subject getSubject()
-
doAs
public static <T> T doAs(Subject subject, PrivilegedAction<T> action)
-
doAsPrivileged
public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext acc)
-
doAs
public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException
- Throws:
PrivilegedActionException
-
doAsPrivileged
public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext acc) throws PrivilegedActionException
- Throws:
PrivilegedActionException
-
-