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

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

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

Subject.doAs_PrivilegedAction介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章