Exemplo n.º 1
0
  public BootstrapHost(String name, Properties props) {
    super(name, props);
    Singletons.replace(BootstrapHostService.class, this);

    try {
      workerManager = new WorkerManager();
      setWorkerManagerAddress(workerManager.getAddress());

      notificationManager = new NotificationManager();
      setNotificationManagerAddress(notificationManager.getAddress());

      statisticsManager = new StatisticsManager();
      setStatisticsManagerAddress(statisticsManager.getAddress());

      broadcastMessageAgent = new BroadcastMessageAgent();
      setBroadcastMessageAgentAddress(broadcastMessageAgent.getAddress());

      WorkerGroupFactory.startup(workerManager);

      initializeCatalogServices();

      if (GroupManager.getCoordinationServices().localMemberIsOldestMember()) doGlobalRecovery();

      registerMBeans();

    } catch (PEException e) {
      throw new RuntimeException("Failed to start DVE server - " + e.rootCause().getMessage(), e);
    } catch (Throwable e) {
      throw new RuntimeException("Failed to start DVE server - " + e.getMessage(), e);
    }
  }
Exemplo n.º 2
0
  @Override
  protected void close() {
    unregisterMBeans();

    super.close();

    // No shutdown methods should throw exceptions as we could do nothing but print it
    notificationManager.shutdown();
    WorkerGroupFactory.shutdown(workerManager);
    workerManager.shutdown();
    statisticsManager.shutdown();
    broadcastMessageAgent.shutdown();
  }