/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Runs the code defined by {@code action} using the permissions granted to * the {@code Subject} itself and to the code as well. * * @param subject * the distinguished {@code Subject}. * @param action * the code to be run. * @return the {@code Object} returned when running the {@code action}. */ @SuppressWarnings("unchecked") public static <T> T doAs(Subject subject, PrivilegedAction<T> action) { return doAs_PrivilegedAction(subject, action, AccessController.getContext()); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }
/** * Run the code defined by {@code action} using the permissions granted to * the {@code 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}. */ @SuppressWarnings("unchecked") public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action, AccessControlContext context) { if (context == null) { return doAs_PrivilegedAction(subject, action, new AccessControlContext( new ProtectionDomain[0])); } return doAs_PrivilegedAction(subject, action, context); }