spring-framework / org.springframework.util.concurrent

Package org.springframework.util.concurrent

Types

CompletableToListenableFutureAdapter

open class CompletableToListenableFutureAdapter<T : Any> : ListenableFuture<T>

Adapts a CompletableFuture or CompletionStage into a Spring ListenableFuture.

FutureAdapter

abstract class FutureAdapter<T : Any, S : Any> : Future<T>

Abstract class that adapts a Future parameterized over S into a Future parameterized over T. All methods are delegated to the adaptee, where #get() and #get(long, TimeUnit) call #adapt(Object) on the adaptee's result.

ListenableFutureAdapter

abstract class ListenableFutureAdapter<T : Any, S : Any> : FutureAdapter<T, S>, ListenableFuture<T>

Abstract class that adapts a ListenableFuture parameterized over S into a ListenableFuture parameterized over T. All methods are delegated to the adaptee, where #get(), #get(long, java.util.concurrent.TimeUnit), and ListenableFutureCallback#onSuccess(Object) call #adapt(Object) on the adaptee's result.

ListenableFutureTask

open class ListenableFutureTask<T : Any> : FutureTask<T>, ListenableFuture<T>

Extension of FutureTask that implements ListenableFuture.

SettableListenableFuture

open class SettableListenableFuture<T : Any> : ListenableFuture<T>

A ListenableFuture whose value can be set via #set(Object) or #setException(Throwable). It may also get cancelled.

Inspired by com.google.common.util.concurrent.SettableFuture.