Package com.google.common.eventbus

Examples of com.google.common.eventbus.EventBus.register()


        ((ProjectComponent) o).setProject(getProject());
      }
      if (o instanceof AggregatedEventListener) {
        ((AggregatedEventListener) o).setOuter(this);
      }
      aggregatedBus.register(o);
    }

    if (testClassNames.isEmpty()) {
      aggregatedBus.post(new AggregatedQuitEvent());
    } else {
View Full Code Here


      Collections.sort(testClassNames);
     
      // Prepare a pool of suites dynamically dispatched to slaves as they become idle.
      final Deque<String> stealingQueue =
          new ArrayDeque<String>(loadBalanceSuites(slaveInfos, testClassNames, balancers));
      aggregatedBus.register(new Object() {
        @Subscribe @SuppressWarnings("unused")
        public void onSlaveIdle(SlaveIdle slave) {
          if (stealingQueue.isEmpty()) {
            slave.finished();
          } else {
View Full Code Here

    commandline.createArgument().setValue(SlaveMain.OPTION_STDIN);

    final EventBus eventBus = new EventBus("slave-" + slave.id);
    final DiagnosticsListener diagnosticsListener = new DiagnosticsListener(slave, this);
    eventBus.register(diagnosticsListener);
    eventBus.register(new AggregatingListener(aggregatedBus, slave));

    final AtomicReference<Charset> clientCharset = new AtomicReference<Charset>();
    final AtomicBoolean clientWithLimitedCharset = new AtomicBoolean();
    final PrintWriter w = new PrintWriter(Files.newWriter(classNamesDynamic, Charsets.UTF_8));
View Full Code Here

    commandline.createArgument().setValue(SlaveMain.OPTION_STDIN);

    final EventBus eventBus = new EventBus("slave-" + slave.id);
    final DiagnosticsListener diagnosticsListener = new DiagnosticsListener(slave, this);
    eventBus.register(diagnosticsListener);
    eventBus.register(new AggregatingListener(aggregatedBus, slave));

    final AtomicReference<Charset> clientCharset = new AtomicReference<Charset>();
    final AtomicBoolean clientWithLimitedCharset = new AtomicBoolean();
    final PrintWriter w = new PrintWriter(Files.newWriter(classNamesDynamic, Charsets.UTF_8));
    eventBus.register(new Object() {
View Full Code Here

    eventBus.register(new AggregatingListener(aggregatedBus, slave));

    final AtomicReference<Charset> clientCharset = new AtomicReference<Charset>();
    final AtomicBoolean clientWithLimitedCharset = new AtomicBoolean();
    final PrintWriter w = new PrintWriter(Files.newWriter(classNamesDynamic, Charsets.UTF_8));
    eventBus.register(new Object() {
      @SuppressWarnings("unused")
      @Subscribe
      public void onIdleSlave(final SlaveIdle idleSlave) {
        aggregatedBus.post(new SlaveIdle() {
          @Override
View Full Code Here

        PollingPropertiesFileConfigurationProvider configurationProvider =
            new PollingPropertiesFileConfigurationProvider(agentName,
                configurationFile, eventBus, 30);
        components.add(configurationProvider);
        application = new Application(components);
        eventBus.register(application);
      } else {
        PropertiesFileConfigurationProvider configurationProvider =
            new PropertiesFileConfigurationProvider(agentName,
                configurationFile);
        application = new Application();
View Full Code Here

    ConfigurationProvider configurationProvider = mock(ConfigurationProvider.class);
    when(configurationProvider.getConfiguration()).thenReturn(materializedConfiguration);

    Application application = new Application();
    eventBus.register(application);
    eventBus.post(materializedConfiguration);
    application.start();

    Thread.sleep(1000L);
View Full Code Here

          new PollingPropertiesFileConfigurationProvider("host1",
              configFile, eventBus, 1);
      List<LifecycleAware> components = Lists.newArrayList();
      components.add(configurationProvider);
      Application application = new Application(components);
      eventBus.register(application);
      application.start();
      Thread.sleep(random.nextInt(10000));
      application.stop();
    }
  }
View Full Code Here

      replay(mockFuture);
      replay(schedulerMock);

      CoutingEventHandler handler = new CoutingEventHandler();
      EventBus eventBus = new EventBus();
      eventBus.register(handler);

      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
            eventBus);

      assertNull(monitor.getFuture());
View Full Code Here

      replay(mockFuture);
      replay(schedulerMock);

      CoutingEventHandler handler = new CoutingEventHandler();
      EventBus eventBus = new EventBus();
      eventBus.register(handler);

      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.FAILED),
            eventBus);

      assertNull(monitor.getFuture());
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.