インタフェースjava.util.concurrent.Executor
の使用
パッケージ
説明
組込みのHTTPサーバーの構築に使用できる、単純で高度なHTTPサーバーAPIを提供します。
HTTPクライアントおよびWebSocket API
Javaプログラミング言語を使用して、データ・ソース(通常はリレーショナル・データベース)に格納されているデータにアクセスして処理するためのAPIを提供します。
並行プログラミングでよく使用されるユーティリティ・クラスです。
Java Management Extensionsのコア・クラスを提供します。
-
com.sun.net.httpserverでのExecutorの使用
修飾子と型メソッド説明abstract Executor
HttpServer.getExecutor()
このサーバーExecutor
オブジェクトがHttpServer.setExecutor(Executor)
で指定されている場合はそれを返し、何も指定されていない場合はnull
を返します。 -
java.net.httpでのExecutorの使用
修飾子と型メソッド説明非同期および依存タスクに使用されるエグゼキュータを設定します。 -
java.sqlでのExecutorの使用
修飾子と型メソッド説明void
オープン接続を終了します。void
Connection.setNetworkTimeout(Executor executor, int milliseconds)
Connection
またはConnection
から作成されたオブジェクトが、データベースが任意の1つの要求に応答するのを待つ最大期間を設定します。 -
java.util.concurrentでのExecutorの使用
修飾子と型クラス説明class
ExecutorService
実行メソッドのデフォルト実装を提供します。class
ForkJoinTask
を実行するためのExecutorService
。class
指定された遅延時間後または定期的にコマンドを実行するようにスケジュールできるThreadPoolExecutor
です。class
プールされた複数のスレッドの1つを使用して送信された各タスクを実行するExecutorService
です。通常はExecutors
ファクトリ・メソッドを使用して構成されます。修飾子と型メソッド説明CompletableFuture.defaultExecutor()
Executorを指定しない非同期メソッドに使用されるデフォルトのExecutorを返します。static Executor
CompletableFuture.delayedExecutor(long delay, TimeUnit unit)
指定された遅延(非正の場合は遅延なし)の後にデフォルトのexecutorにタスクをサブ・ミットする新しいExecutorを返します。static Executor
CompletableFuture.delayedExecutor(long delay, TimeUnit unit, Executor executor)
指定された遅延(非正の場合は遅延なし)の後に、指定されたベースexecutorにタスクをサブ・ミットする新しいExecutorを返します。SubmissionPublisher.getExecutor()
非同期配信に使用されるExecutorを返します。修飾子と型メソッド説明CompletableFuture.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
CompletionStage.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
指定されたステージが正常に完了したときに、指定されたステージのいずれかが正常に完了したときに、指定されたエグゼキュータを使用して実行され、対応する結果が指定されたアクションの引数として返される新しいCompletionStageを返します。<U> CompletableFuture<U>
CompletableFuture.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn, Executor executor)
<U> CompletionStage<U>
CompletionStage.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn, Executor executor)
このステージまたは指定された他のステージが正常に完了したときに、対応する結果を指定されたアクションへの引数に設定し、指定されたエグゼキュータを使用して実行される新しいCompletionStageを返します。CompletableFuture.completeAsync(Supplier<? extends T> supplier, Executor executor)
指定されたExecutorを使用して非同期タスクから呼び出された、指定されたSupplier関数の結果でこのCompletableFutureを完了します。static Executor
CompletableFuture.delayedExecutor(long delay, TimeUnit unit, Executor executor)
指定された遅延(非正の場合は遅延なし)の後に、指定されたベースexecutorにタスクをサブ・ミットする新しいExecutorを返します。default CompletionStage<T>
CompletionStage.exceptionallyAsync(Function<Throwable,? extends T> fn, Executor executor)
このステージが例外的に完了すると、指定されたエグゼキュータを使用して、指定された関数の引数としてこのステージ例外で実行される新しいCompletionStageを返します。default CompletionStage<T>
CompletionStage.exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn, Executor executor)
新しいCompletionStageを返します。このステージが例外的に完了すると、指定されたエグゼキュータを使用して、このステージ例外に適用された指定関数の結果を使用して構成されます。<U> CompletableFuture<U>
CompletableFuture.handleAsync(BiFunction<? super T,Throwable,? extends U> fn, Executor executor)
<U> CompletionStage<U>
CompletionStage.handleAsync(BiFunction<? super T,Throwable,? extends U> fn, Executor executor)
このステージが正常終了または異常終了した際に指定されたエグゼキュータを使って実行される新しいCompletionStageを返します(実行時には、指定された関数の引数としてこのステージの結果と例外が使用される)。CompletableFuture.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor)
CompletionStage.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor)
これと他のステージが両方とも正常に完了した場合に、指定されたアクションを指定されたエグゼキュータを使用して実行する新しいCompletionStageを返します。CompletableFuture.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor)
CompletionStage.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor)
このステージと指定された他のステージのどちらかが正常に完了したときに指定されたエグゼキュータを使用して指定されたアクションを実行する新しいCompletionStageを返します。static CompletableFuture<Void>
指定されたexecutorで実行されているタスクが指定されたアクションの実行後に非同期に完了する新しいCompletableFutureを返します。static <U> CompletableFuture<U>
CompletableFuture.supplyAsync(Supplier<U> supplier, Executor executor)
指定されたエグゼキュータで実行されているタスクが指定されたサプライヤを呼び出して取得した値を使用して非同期的に完了する新しいCompletableFutureを返します。CompletableFuture.thenAcceptAsync(Consumer<? super T> action, Executor executor)
CompletionStage.thenAcceptAsync(Consumer<? super T> action, Executor executor)
このステージが正常に完了したときに、このステージの結果を指定されたアクションへの引数に設定し、指定されたエグゼキュータを使用して実行される新しいCompletionStageを返します。<U> CompletableFuture<Void>
CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action, Executor executor)
<U> CompletionStage<Void>
CompletionStage.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action, Executor executor)
これと他のステージが両方とも正常に完了したときに、指定されたエグゼキュータを使用して実行され、2つの結果が指定されたアクションの引数として実行される新しいCompletionStageを返します。<U> CompletableFuture<U>
CompletableFuture.thenApplyAsync(Function<? super T,? extends U> fn, Executor executor)
<U> CompletionStage<U>
CompletionStage.thenApplyAsync(Function<? super T,? extends U> fn, Executor executor)
このステージが正常に完了したときに、このステージの結果を指定された関数への引数に設定し、指定されたエグゼキュータを使用して実行される新しいCompletionStageを返します。<U, V> CompletableFuture<V>
CompletableFuture.thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn, Executor executor)
<U, V> CompletionStage<V>
CompletionStage.thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn, Executor executor)
これと他のステージが両方とも正常に完了したときに、指定された関数の引数として2つの結果を指定して、指定されたexecutorを使用して実行される新しいCompletionStageを返します。<U> CompletableFuture<U>
CompletableFuture.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn, Executor executor)
<U> CompletionStage<U>
CompletionStage.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn, Executor executor)
指定されたExecutorによって返されたCompletionStageと同じ値で完了し、指定されたExecutorを使用して実行される新しいCompletionStageを返します。CompletableFuture.thenRunAsync(Runnable action, Executor executor)
CompletionStage.thenRunAsync(Runnable action, Executor executor)
このステージが正常に完了したときに指定されたExecutorを使用して指定されたアクションを実行する新しいCompletionStageを返します。CompletableFuture.whenCompleteAsync(BiConsumer<? super T,? super Throwable> action, Executor executor)
CompletionStage.whenCompleteAsync(BiConsumer<? super T,? super Throwable> action, Executor executor)
このステージが完了したときに、指定されたExecutorを使用して指定されたアクションを実行するこのステージと同じ結果または例外を使用して新しいCompletionStageを返します。修飾子コンストラクタ説明ExecutorCompletionService(Executor executor)
基本タスクの実行用に指定されたexecutorを使用し、完了キューとしてLinkedBlockingQueue
を使用して、ExecutorCompletionServiceを作成します。ExecutorCompletionService(Executor executor, BlockingQueue<Future<V>> completionQueue)
基本タスクの実行用に指定されたexecutorを使用し、完了キューとして指定されたキューを使用して、ExecutorCompletionServiceを作成します。SubmissionPublisher(Executor executor, int maxBufferCapacity)
指定されたExecutorを使用してサブスクライバに非同期に配信するための新しいSubmissionPublisherを作成します。各サブスクライバの最大バッファ・サイズは指定されており、メソッドonNext
のサブスクライバ例外ハンドラはありません。SubmissionPublisher(Executor executor, int maxBufferCapacity, BiConsumer<? super Flow.Subscriber<? super T>,? super Throwable> handler)
各サブスクライバに対して指定された最大バッファ・サイズでサブスクライバへの非同期配信用に、指定されたExecutorを使用して新しいSubmissionPublisherを作成し、非nullの場合、サブスクライバがonNext
メソッドで例外をスローしたときに呼び出されます。 -
javax.managementでのExecutorの使用
修飾子コンストラクタ説明NotificationBroadcasterSupport(Executor executor)
NotificationBroadcasterSupportを構築します。ここで、各リスナーは指定したExecutor
を使って呼び出されます。NotificationBroadcasterSupport(Executor executor, MBeanNotificationInfo... info)
送信可能な通知に関する情報を使って、NotificationBroadcasterSupportを構築します。各リスナーは、指定したExecutor
を使って呼び出されます。