Class MappingCheckedFuture<V,X extends Exception>
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.util.concurrent.ForwardingFuture<V>
-
- com.google.common.util.concurrent.ForwardingListenableFuture<V>
-
- com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture<V>
-
- com.google.common.util.concurrent.AbstractCheckedFuture<V,X>
-
- org.opendaylight.controller.md.sal.common.api.MappingCheckedFuture<V,X>
-
- Type Parameters:
V- The result type returned by this Future's get methodX- The checked exception type
- All Implemented Interfaces:
CheckedFuture<V,X>,ListenableFuture<V>,Future<V>
@Deprecated(forRemoval=true) public final class MappingCheckedFuture<V,X extends Exception> extends AbstractCheckedFuture<V,X>
Deprecated, for removal: This API element is subject to removal in a future version.An implementation of CheckedFuture that provides similar behavior for thegetmethods that thecheckedGetmethods provide.For
CancellationExceptionandInterruptedException, the specified exception mapper is invoked to translate them to the checked exception type.For
ExecutionException, the mapper is invoked to translate the cause to the checked exception and a new ExecutionException is thrown with the translated cause.- Author:
- Thomas Pantelis
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingListenableFuture
ForwardingListenableFuture.SimpleForwardingListenableFuture<V extends Object>
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.ForwardingFuture
ForwardingFuture.SimpleForwardingFuture<V extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <V,X extends Exception>
MappingCheckedFuture<V,X>create(ListenableFuture<V> delegate, Function<Exception,X> mapper)Deprecated, for removal: This API element is subject to removal in a future version.Creates a newMappingCheckedFuturethat wraps the givenListenableFuturedelegate.Vget()Deprecated, for removal: This API element is subject to removal in a future version.Vget(long timeout, TimeUnit unit)Deprecated, for removal: This API element is subject to removal in a future version.protected XmapException(Exception e)Deprecated, for removal: This API element is subject to removal in a future version.-
Methods inherited from class com.google.common.util.concurrent.AbstractCheckedFuture
checkedGet, checkedGet
-
Methods inherited from class com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture
delegate
-
Methods inherited from class com.google.common.util.concurrent.ForwardingListenableFuture
addListener
-
Methods inherited from class com.google.common.util.concurrent.ForwardingFuture
cancel, isCancelled, isDone
-
Methods inherited from class com.google.common.collect.ForwardingObject
toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
-
Methods inherited from interface com.google.common.util.concurrent.ListenableFuture
addListener
-
-
-
-
Method Detail
-
create
public static <V,X extends Exception> MappingCheckedFuture<V,X> create(ListenableFuture<V> delegate, Function<Exception,X> mapper)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newMappingCheckedFuturethat wraps the givenListenableFuturedelegate.- Parameters:
delegate- theListenableFutureto wrapmapper- the mappingFunctionused to translate exceptions from the delegate- Returns:
- a new
MappingCheckedFuture
-
mapException
protected X mapException(Exception e)
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
mapExceptionin classAbstractCheckedFuture<V,X extends Exception>
-
get
public V get() throws InterruptedException, ExecutionException
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getin interfaceFuture<V>- Overrides:
getin classForwardingFuture<V>- Throws:
InterruptedExceptionExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getin interfaceFuture<V>- Overrides:
getin classForwardingFuture<V>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-