Class ExecutorProviders


  • public final class ExecutorProviders
    extends Object
    A utility class with a methods for handling executor injection registration and proper disposal.
    Author:
    Marek Potociar
    • Method Detail

      • registerExecutorBindings

        public static void registerExecutorBindings​(org.glassfish.jersey.internal.inject.InjectionManager injectionManager)
        Create qualified ExecutorService and ScheduledExecutorService injection bindings based on the registered providers implementing the ExecutorServiceProvider and/or ScheduledExecutorServiceProvider SPI.

        This method supports creation of qualified injection bindings based on custom qualifier annotations attached to the registered provider implementation classes as well as named injection bindings based on the Named qualifier annotation attached to the registered provider implementation classes. ExecutorServiceProvider and ScheduledExecutorServiceProvider will be retrieved from InjectionManager.

        Parameters:
        injectionManager - application's injection manager.
      • registerExecutorBindings

        public static void registerExecutorBindings​(org.glassfish.jersey.internal.inject.InjectionManager injectionManager,
                                                    List<ExecutorServiceProvider> executorProviders,
                                                    List<ScheduledExecutorServiceProvider> scheduledProviders)
        Create qualified ExecutorService and ScheduledExecutorService injection bindings based on the registered providers implementing the ExecutorServiceProvider and/or ScheduledExecutorServiceProvider SPI.

        This method supports creation of qualified injection bindings based on custom qualifier annotations attached to the registered provider implementation classes as well as named injection bindings based on the Named qualifier annotation attached to the registered provider implementation classes.

        Parameters:
        injectionManager - injection manager to register newly created executor bindings.
        executorProviders - all executor providers registered internally in Jersey and in configuration.
        scheduledProviders - all scheduled executor providers registered internally in Jersey and in configuration.