コード例 #1
0
  @Override
  public void start(StartContext context) throws StartException {
    final ExecutorService executorService = getExecutorServiceInjector().getValue();
    this.hostControllerConfigurationPersister =
        new HostControllerConfigurationPersister(
            environment, hostControllerInfo, executorService, extensionRegistry);
    setConfigurationPersister(hostControllerConfigurationPersister);
    prepareStepHandler.setExecutorService(executorService);
    ThreadFactory threadFactory =
        new JBossThreadFactory(
            new ThreadGroup("proxy-threads"),
            Boolean.FALSE,
            null,
            "%G - %t",
            null,
            null,
            doPrivileged(GetAccessControlContextAction.getInstance()));
    proxyExecutor = Executors.newCachedThreadPool(threadFactory);
    ThreadFactory pingerThreadFactory =
        new JBossThreadFactory(
            new ThreadGroup("proxy-pinger-threads"),
            Boolean.TRUE,
            null,
            "%G - %t",
            null,
            null,
            doPrivileged(GetAccessControlContextAction.getInstance()));
    pingScheduler = Executors.newScheduledThreadPool(PINGER_POOL_SIZE, pingerThreadFactory);

    super.start(context);
  }
コード例 #2
0
 @Override
 public void start(StartContext context) throws StartException {
   final ExecutorService executorService = getExecutorServiceInjector().getValue();
   this.hostControllerConfigurationPersister =
       new HostControllerConfigurationPersister(environment, hostControllerInfo, executorService);
   setConfigurationPersister(hostControllerConfigurationPersister);
   prepareStepHandler.setExecutorService(executorService);
   super.start(context);
 }
コード例 #3
0
  static ServiceController<ModelController> addService(
      final ServiceTarget serviceTarget,
      final HostControllerEnvironment environment,
      final HostRunningModeControl runningModeControl,
      final ControlledProcessState processState,
      final BootstrapListener bootstrapListener,
      final PathManagerService pathManager) {
    final ConcurrentMap<String, ProxyController> hostProxies =
        new ConcurrentHashMap<String, ProxyController>();
    final Map<String, ProxyController> serverProxies =
        new ConcurrentHashMap<String, ProxyController>();
    final LocalHostControllerInfoImpl hostControllerInfo =
        new LocalHostControllerInfoImpl(processState, environment);
    final AbstractVaultReader vaultReader = service(AbstractVaultReader.class);
    ROOT_LOGGER.debugf("Using VaultReader %s", vaultReader);
    final ContentRepository contentRepository =
        ContentRepository.Factory.create(environment.getDomainContentDir());
    final IgnoredDomainResourceRegistry ignoredRegistry =
        new IgnoredDomainResourceRegistry(hostControllerInfo);
    final ExtensionRegistry extensionRegistry =
        new ExtensionRegistry(ProcessType.HOST_CONTROLLER, runningModeControl);
    final DomainControllerRuntimeIgnoreTransformationRegistry runtimeIgnoreTransformationRegistry =
        new DomainControllerRuntimeIgnoreTransformationRegistry();
    final PrepareStepHandler prepareStepHandler =
        new PrepareStepHandler(
            hostControllerInfo,
            contentRepository,
            hostProxies,
            serverProxies,
            ignoredRegistry,
            extensionRegistry,
            runtimeIgnoreTransformationRegistry);
    final ExpressionResolver expressionResolver = new RuntimeExpressionResolver(vaultReader);
    DomainModelControllerService service =
        new DomainModelControllerService(
            environment,
            runningModeControl,
            processState,
            hostControllerInfo,
            contentRepository,
            hostProxies,
            serverProxies,
            prepareStepHandler,
            vaultReader,
            ignoredRegistry,
            bootstrapListener,
            pathManager,
            expressionResolver,
            new DelegatingResourceDefinition(),
            extensionRegistry,
            runtimeIgnoreTransformationRegistry);

    ApplyMissingDomainModelResourcesHandler applyMissingDomainModelResourcesHandler =
        new ApplyMissingDomainModelResourcesHandler(
            service, environment, hostControllerInfo, ignoredRegistry);
    prepareStepHandler.initialize(applyMissingDomainModelResourcesHandler);

    return serviceTarget
        .addService(SERVICE_NAME, service)
        .addDependency(
            HostControllerService.HC_EXECUTOR_SERVICE_NAME,
            ExecutorService.class,
            service.getExecutorServiceInjector())
        .addDependency(
            ProcessControllerConnectionService.SERVICE_NAME,
            ProcessControllerConnectionService.class,
            service.injectedProcessControllerConnection)
        .addDependency(PathManagerService.SERVICE_NAME) // ensure this is up
        .setInitialMode(ServiceController.Mode.ACTIVE)
        .install();
  }