インタフェースjava.util.concurrent.RejectedExecutionHandler
の使用
RejectedExecutionHandlerを使用するパッケージ
-
java.util.concurrentでのRejectedExecutionHandlerの使用
RejectedExecutionHandlerを実装しているjava.util.concurrentのクラス修飾子と型クラス説明static class
RejectedExecutionException
をスローする、拒否されたタスクのハンドラ。static class
executorがシャットダウンしていない場合に、execute
メソッドの呼出しスレッド内で、拒否されたタスクを直接実行する、拒否されたタスクのハンドラです。シャットダウンしている場合、タスクは破棄されます。static class
executorがシャットダウンしていない場合に、もっとも古い未処理の要求を破棄してexecute
を再試行する、拒否されたタスクのハンドラです。シャットダウンしている場合、タスクは破棄されます。static class
拒否されたタスクを通知なしで破棄する拒否されたタスクのハンドラです。型RejectedExecutionHandlerのパラメータを持つjava.util.concurrentのメソッド修飾子と型メソッド説明void
ThreadPoolExecutor.setRejectedExecutionHandler
(RejectedExecutionHandler handler) 実行可能でないタスクの新しいハンドラを設定します。型RejectedExecutionHandlerのパラメータを持つjava.util.concurrentのコンストラクタ修飾子コンストラクタ説明ScheduledThreadPoolExecutor
(int corePoolSize, RejectedExecutionHandler handler) 指定された初期パラメータを使って、新しいScheduledThreadPoolExecutor
を作成します。ScheduledThreadPoolExecutor
(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) 指定された初期パラメータを使って、新しいScheduledThreadPoolExecutor
を作成します。ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) 指定された初期パラメータと「デフォルトのスレッド・ファクトリ」を使用して、新しいThreadPoolExecutor
を作成します。ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) 指定された初期パラメータを使って、新しいThreadPoolExecutor
を作成します。