インタフェースjava.util.concurrent.RejectedExecutionHandler
の使用
RejectedExecutionHandlerを使用するパッケージ
-
java.util.concurrentでのRejectedExecutionHandlerの使用
RejectedExecutionHandlerを実装しているjava.util.concurrentのクラス修飾子と型クラス説明static classRejectedExecutionExceptionをスローする、拒否されたタスクのハンドラ。static classexecutorがシャットダウンしていない場合に、executeメソッドの呼出しスレッド内で、拒否されたタスクを直接実行する、拒否されたタスクのハンドラです。シャットダウンしている場合、タスクは破棄されます。static classexecutorがシャットダウンしていない場合に、もっとも古い未処理の要求を破棄してexecuteを再試行する、拒否されたタスクのハンドラです。シャットダウンしている場合、タスクは破棄されます。static class拒否されたタスクを通知なしで破棄する拒否されたタスクのハンドラです。型RejectedExecutionHandlerのパラメータを持つjava.util.concurrentのメソッド修飾子と型メソッド説明voidThreadPoolExecutor.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を作成します。