Examples of ExecutorServiceModule


Examples of org.jclouds.concurrent.config.ExecutorServiceModule

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
                                                             .add(new ExecutorServiceModule(executor, executor))
                                                             .build())
                                        .buildApi(DelegatingApi.class);
      api.close();
      verify(executor);
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

      Injector i = Guice.createInjector(new AbstractModule() {
         protected void configure() {
            bindConstant().annotatedWith(named(PROPERTY_IO_WORKER_THREADS)).to(1);
            bindConstant().annotatedWith(named(PROPERTY_USER_THREADS)).to(1);
         }
      }, new LifeCycleModule(), new ExecutorServiceModule());
      // TODO: currently have to manually invoke the execution list, as otherwise it may occur
      // before everything is wired up
      i.getInstance(ExecutionList.class).execute();
      return i;
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

   }

   @Test
   public void testAddExecutorServiceModuleIfNotPresent() {
      List<Module> modules = Lists.newArrayList();
      ExecutorServiceModule module = new ExecutorServiceModule();
      modules.add(module);
      ContextBuilder.addExecutorServiceIfNotPresent(modules);
      assertEquals(modules.size(), 1);
      assertEquals(modules.remove(0), module);
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

@SingleThreaded
public class GoogleAppEngineConfigurationModule extends AbstractModule {
   private final Module userExecutorModule;

   public GoogleAppEngineConfigurationModule() {
      this(new ExecutorServiceModule(sameThreadExecutor(), sameThreadExecutor()));
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

         if (any(modules, new Predicate<Module>() {
            public boolean apply(Module input) {
               return input.getClass().isAnnotationPresent(SingleThreaded.class);
            }
         })) {
            modules.add(new ExecutorServiceModule(sameThreadExecutor(), sameThreadExecutor()));
         } else {
            modules.add(new ExecutorServiceModule());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

   }

   @Test
   public void testAddExecutorServiceModuleIfNotPresent() {
      List<Module> modules = Lists.newArrayList();
      ExecutorServiceModule module = new ExecutorServiceModule();
      modules.add(module);
      ContextBuilder.addExecutorServiceIfNotPresent(modules);
      assertEquals(modules.size(), 1);
      assertEquals(modules.remove(0), module);
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
                                                             .add(new ExecutorServiceModule(executor, executor))
                                                             .build())
                                        .buildApi(DelegatingApi.class);
      api.close();
      verify(executor);
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

      Injector i = Guice.createInjector(new AbstractModule() {
         protected void configure() {
            bindConstant().annotatedWith(named(PROPERTY_IO_WORKER_THREADS)).to(1);
            bindConstant().annotatedWith(named(PROPERTY_USER_THREADS)).to(1);
         }
      }, new LifeCycleModule(), new ExecutorServiceModule());
      // TODO: currently have to manually invoke the execution list, as otherwise it may occur
      // before everything is wired up
      i.getInstance(ExecutionList.class).execute();
      return i;
   }
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

public class EventBusModuleTest {
    private Injector injector;
   
    @BeforeClass
    public void setup() {
        ExecutorServiceModule userExecutorModule = new ExecutorServiceModule() {
            @Override
            protected void configure() {
               bindConstant().annotatedWith(Names.named(Constants.PROPERTY_IO_WORKER_THREADS)).to(1);
               bindConstant().annotatedWith(Names.named(Constants.PROPERTY_USER_THREADS)).to(1);
               super.configure();
View Full Code Here

Examples of org.jclouds.concurrent.config.ExecutorServiceModule

      RestContextSpec<SDNAuthClient, SDNAuthAsyncClient> contextSpec = contextSpec("test", endpoint, "1", "", identity,
               credential, SDNAuthClient.class, SDNAuthAsyncClient.class);

      context = createContextBuilder(
               contextSpec,
               ImmutableSet.<Module> of(new Log4JLoggingModule(), new ExecutorServiceModule(MoreExecutors
                        .sameThreadExecutor(), MoreExecutors.sameThreadExecutor()))).buildContext();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.