Package org.somda.sdc.common.util
Class ExecutorWrapperUtil
- java.lang.Object
-
- org.somda.sdc.common.util.ExecutorWrapperUtil
-
public class ExecutorWrapperUtil extends Object
Utilities for creating and using ExecutorWrapperService with guice's AbstractModule.
-
-
Constructor Summary
Constructors Constructor Description ExecutorWrapperUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends com.google.inject.AbstractModule>
voidbindListeningExecutor(T module, Callable<com.google.common.util.concurrent.ListeningExecutorService> executor, Class<? extends Annotation> annotation)Binds a ListeningExecutorService wrapped in a Callable to an annotation.static voidbindScheduledExecutor(com.google.inject.AbstractModule module, Callable<ScheduledExecutorService> executor, Class<? extends Annotation> annotation)Binds a ScheduledExecutorService wrapped in a Callable to an annotation.static MethodgetBindMethod(com.google.inject.AbstractModule module)
-
-
-
Method Detail
-
bindScheduledExecutor
public static void bindScheduledExecutor(com.google.inject.AbstractModule module, Callable<ScheduledExecutorService> executor, Class<? extends Annotation> annotation)Binds a ScheduledExecutorService wrapped in a Callable to an annotation.The callable will be wrapped inside a ExecutorWrapperService before being bound to enable Service functionality for the executor.
- Parameters:
module- configuration module to bind executor to.executor- wrapped inside a Callable.annotation- to be bound to.
-
bindListeningExecutor
public static <T extends com.google.inject.AbstractModule> void bindListeningExecutor(T module, Callable<com.google.common.util.concurrent.ListeningExecutorService> executor, Class<? extends Annotation> annotation)Binds a ListeningExecutorService wrapped in a Callable to an annotation.The callable will be wrapped inside a ExecutorWrapperService before being bound to enable Service functionality for the executor.
- Parameters:
module- configuration module to bind executor to.executor- wrapped inside a Callable.annotation- to be bound to.
-
-