Class ExecutorWrapperUtil

    • Constructor Detail

      • ExecutorWrapperUtil

        public ExecutorWrapperUtil()
    • Method Detail

      • 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.
      • getBindMethod

        public static Method getBindMethod​(com.google.inject.AbstractModule module)
                                    throws Exception
        Throws:
        Exception