/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action) throws PrivilegedActionException { return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the subject and to the code itself, additionally providing a more * specific context. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @param context * the specific context in which the {@code action} is invoked. * if {@code null} a new {@link AccessControlContext} is * instantiated. * @return the {@code Object} returned when running the {@code action}. * @throws PrivilegedActionException * if running the {@code action} throws an exception. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException { if (context == null) { return doAs_PrivilegedExceptionAction(subject, action, new AccessControlContext(new ProtectionDomain[0])); } return doAs_PrivilegedExceptionAction(subject, action, context); }