モジュール java.base
パッケージ java.util.concurrent

クラスThreadPoolExecutor.CallerRunsPolicy

java.lang.Object
java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy
すべての実装されたインタフェース:
RejectedExecutionHandler
含まれているクラス:
ThreadPoolExecutor

public static class ThreadPoolExecutor.CallerRunsPolicy
extends Object
implements RejectedExecutionHandler
executorがシャットダウンしていない場合に、executeメソッドの呼出しスレッド内で、拒否されたタスクを直接実行する、拒否されたタスクのハンドラです。シャットダウンしている場合、タスクは破棄されます。
  • コンストラクタのサマリー

    コンストラクタ 
    コンストラクタ 説明
    CallerRunsPolicy()
    CallerRunsPolicyを作成します。
  • メソッドのサマリー

    修飾子と型 メソッド 説明
    void rejectedExecution​(Runnable r, ThreadPoolExecutor e)
    executorがシャットダウンしていない場合に、呼出し側のスレッドでタスクrを実行します。シャットダウンしている場合、タスクは破棄されます。

    クラス java.lang.Objectで宣言されたメソッド

    cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait
  • コンストラクタの詳細

    • CallerRunsPolicy

      public CallerRunsPolicy()
      CallerRunsPolicyを作成します。
  • メソッドの詳細

    • rejectedExecution

      public void rejectedExecution​(Runnable r, ThreadPoolExecutor e)
      executorがシャットダウンしていない場合に、呼出し側のスレッドでタスクrを実行します。シャットダウンしている場合、タスクは破棄されます。
      定義:
      rejectedExecution、インタフェース: RejectedExecutionHandler
      パラメータ:
      r - 実行されることを要求された実行可能なタスク
      e - このタスクの実行を試みるexecutor