b.append("\n\t").append(key).append(" = ").append(env.get(key));
}
CONFIG_LOGGER.trace(b);
}
}
final ServiceTarget serviceTarget = context.getChildTarget();
final ServiceController<?> myController = context.getController();
final ServiceContainer serviceContainer = myController.getServiceContainer();
futureContainer = new FutureServiceContainer();
long startTime = this.startTime;
if (startTime == -1) {
startTime = System.currentTimeMillis();
} else {
this.startTime = -1;
}
final BootstrapListener bootstrapListener = new BootstrapListener(serviceContainer, startTime, serviceTarget, futureContainer, prettyVersion + " (Host Controller)");
serviceTarget.addListener(ServiceListener.Inheritance.ALL, bootstrapListener);
myController.addListener(bootstrapListener);
// The first default services are registered before the bootstrap operations are executed.
// Install the process controller client
final ProcessControllerConnectionService processControllerClient = new ProcessControllerConnectionService(environment, authCode);
serviceTarget.addService(ProcessControllerConnectionService.SERVICE_NAME, processControllerClient).install();
// Thread Factory and Executor Services
final ServiceName threadFactoryServiceName = HC_SERVICE_NAME.append("thread-factory");
final ThreadFactoryService threadFactoryService = new ThreadFactoryService();
threadFactoryService.setThreadGroupName("Host Controller Service Threads");
serviceTarget.addService(threadFactoryServiceName, threadFactoryService).install();
final HostControllerExecutorService executorService = new HostControllerExecutorService();
serviceTarget.addService(HC_EXECUTOR_SERVICE_NAME, executorService)
.addDependency(threadFactoryServiceName, ThreadFactory.class, executorService.threadFactoryValue)
.install();
// Install required path services. (Only install those identified as required)
AbsolutePathService.addService(HostControllerEnvironment.HOME_DIR, environment.getHomeDir().getAbsolutePath(), serviceTarget);