Package org.threadly.concurrent.wrapper
Class SubmitterExecutorAdapter
- java.lang.Object
-
- org.threadly.concurrent.AbstractSubmitterExecutor
-
- org.threadly.concurrent.wrapper.SubmitterExecutorAdapter
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,SubmitterExecutor
public class SubmitterExecutorAdapter extends AbstractSubmitterExecutor
A simple wrapper class forExecutor
implementations to provideSubmitterExecutor
capabilities.In addition this implementation returns
ListenableFuture
future implementations, making it an easy way to convert your favorite executor to use ListenableFutures.- Since:
- 4.8.0 (since 1.0.0 as org.threadly.concurrent.ExecutorWrapper)
-
-
Constructor Summary
Constructors Constructor Description SubmitterExecutorAdapter(java.util.concurrent.Executor executor)
Constructors a new wrapper instance with the provided executor to defer calls to.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SubmitterExecutor
adaptExecutor(java.util.concurrent.Executor executor)
Ensures the providedExecutor
is of typeSubmitterExecutor
, adapting it with this class if necessary to provide the interface.-
Methods inherited from class org.threadly.concurrent.AbstractSubmitterExecutor
execute, submit, submit
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.threadly.concurrent.SubmitterExecutor
submit
-
-
-
-
Method Detail
-
adaptExecutor
public static SubmitterExecutor adaptExecutor(java.util.concurrent.Executor executor)
Ensures the providedExecutor
is of typeSubmitterExecutor
, adapting it with this class if necessary to provide the interface.- Parameters:
executor
- Executor to test type or wrap if necessary- Returns:
- An implementation of
SubmitterExecutor
-
-