java.util.concurrent.ForkJoinPool.checkPermission()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(12.6k)|赞(0)|评价(0)|浏览(119)

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

ForkJoinPool.checkPermission介绍

[英]If there is a security manager, makes sure caller has permission to modify threads.
[中]如果有安全管理器,请确保调用者具有修改线程的权限。

代码示例

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

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

Thread.UncaughtExceptionHandler handler,
        boolean asyncMode) {
checkPermission();
if (factory == null)
  throw new NullPointerException();

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Initiates an orderly shutdown in which previously submitted
 * tasks are executed, but no new tasks will be accepted.
 * Invocation has no additional effect if already shut down.
 * Tasks that are in the process of being submitted concurrently
 * during the course of this method may or may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  shutdown = true;
  tryTerminate(false);
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Initiates an orderly shutdown in which previously submitted
 * tasks are executed, but no new tasks will be accepted.
 * Invocation has no additional effect if already shut down.
 * Tasks that are in the process of being submitted concurrently
 * during the course of this method may or may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  shutdown = true;
  tryTerminate(false);
}

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Initiates an orderly shutdown in which previously submitted
 * tasks are executed, but no new tasks will be accepted.
 * Invocation has no additional effect if already shut down.
 * Tasks that are in the process of being submitted concurrently
 * during the course of this method may or may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  shutdown = true;
  tryTerminate(false);
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

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

/**
 * Possibly initiates an orderly shutdown in which previously
 * submitted tasks are executed, but no new tasks will be
 * accepted. Invocation has no effect on execution state if this
 * is the {@link #commonPool()}, and no additional effect if
 * already shut down.  Tasks that are in the process of being
 * submitted concurrently during the course of this method may or
 * may not be rejected.
 *
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public void shutdown() {
  checkPermission();
  tryTerminate(false, true);
}

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

/**
 * Possibly attempts to cancel and/or stop all tasks, and reject
 * all subsequently submitted tasks.  Invocation has no effect on
 * execution state if this is the {@link #commonPool()}, and no
 * additional effect if already shut down. Otherwise, tasks that
 * are in the process of being submitted or executed concurrently
 * during the course of this method may or may not be
 * rejected. This method cancels both existing and unexecuted
 * tasks, in order to permit termination in the presence of task
 * dependencies. So the method always returns an empty list
 * (unlike the case for some other Executors).
 *
 * @return an empty list
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  tryTerminate(true, true);
  return Collections.emptyList();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Attempts to cancel and/or stop all tasks, and reject all
 * subsequently submitted tasks.  Tasks that are in the process of
 * being submitted or executed concurrently during the course of
 * this method may or may not be rejected. This method cancels
 * both existing and unexecuted tasks, in order to permit
 * termination in the presence of task dependencies. So the method
 * always returns an empty list (unlike the case for some other
 * Executors).
 *
 * @return an empty list
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  shutdown = true;
  tryTerminate(true);
  return Collections.emptyList();
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Attempts to cancel and/or stop all tasks, and reject all
 * subsequently submitted tasks.  Tasks that are in the process of
 * being submitted or executed concurrently during the course of
 * this method may or may not be rejected. This method cancels
 * both existing and unexecuted tasks, in order to permit
 * termination in the presence of task dependencies. So the method
 * always returns an empty list (unlike the case for some other
 * Executors).
 *
 * @return an empty list
 * @throws SecurityException if a security manager exists and
 *         the caller is not permitted to modify threads
 *         because it does not hold {@link
 *         java.lang.RuntimePermission}{@code ("modifyThread")}
 */
public List<Runnable> shutdownNow() {
  checkPermission();
  shutdown = true;
  tryTerminate(true);
  return Collections.emptyList();
}

相关文章

微信公众号

最新文章

更多

ForkJoinPool类方法