javax.security.auth.Subject.doAs_PrivilegedExceptionAction()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(75)

本文整理了Java中javax.security.auth.Subject.doAs_PrivilegedExceptionAction()方法的一些代码示例,展示了Subject.doAs_PrivilegedExceptionAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Subject.doAs_PrivilegedExceptionAction()方法的具体详情如下:
包路径:javax.security.auth.Subject
类名称:Subject
方法名:doAs_PrivilegedExceptionAction

Subject.doAs_PrivilegedExceptionAction介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * 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());
}

代码示例来源:origin: robovm/robovm

/**
 * 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);
}

代码示例来源:origin: MobiVM/robovm

/**
 * 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());
}

代码示例来源:origin: ibinti/bugvm

/**
 * 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());
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * 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());
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * 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());
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * 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());
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * 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());
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * 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);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * 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);
}

代码示例来源:origin: ibinti/bugvm

/**
 * 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);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * 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);
}

代码示例来源:origin: MobiVM/robovm

/**
 * 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);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * 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);
}

相关文章