public static ServiceController<?> addService(ServiceTarget serviceTarget, HostPathManagerService service, HostControllerEnvironment hostEnvironment) { ServiceBuilder<?> serviceBuilder = serviceTarget.addService(AbstractControllerService.PATH_MANAGER_CAPABILITY.getCapabilityServiceName(), service).addAliases(SERVICE_NAME); // Add resources and capabilities for the always-present paths service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.HOME_DIR, hostEnvironment.getHomeDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_BASE_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_CONFIG_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_DATA_DIR, hostEnvironment.getDomainDataDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_LOG_DIR, hostEnvironment.getDomainLogDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.CONTROLLER_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); // Registering the actual standard server path capabilities so server config resources can reference them //TODO look if those registrations could be moved to ServerService/DomainModelControllerService.initModel registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_BASE_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_CONFIG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_DATA_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_LOG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_TEMP_DIR); return serviceBuilder.install(); }
public static ServiceController<?> addService(ServiceTarget serviceTarget, HostPathManagerService service, HostControllerEnvironment hostEnvironment) { ServiceBuilder<?> serviceBuilder = serviceTarget.addService(AbstractControllerService.PATH_MANAGER_CAPABILITY.getCapabilityServiceName(), service).addAliases(SERVICE_NAME); // Add resources and capabilities for the always-present paths service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.HOME_DIR, hostEnvironment.getHomeDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_BASE_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_CONFIG_DIR, hostEnvironment.getDomainConfigurationDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_DATA_DIR, hostEnvironment.getDomainDataDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_LOG_DIR, hostEnvironment.getDomainLogDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.DOMAIN_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); service.addHardcodedAbsolutePath(serviceTarget, HostControllerEnvironment.CONTROLLER_TEMP_DIR, hostEnvironment.getDomainTempDir().getAbsolutePath()); // Registering the actual standard server path capabilities so server config resources can reference them //TODO look if those registrations could be moved to ServerService/DomainModelControllerService.initModel registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_BASE_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_CONFIG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_DATA_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_LOG_DIR); registerServerPathCapability(service.localCapRegRef, ServerEnvironment.SERVER_TEMP_DIR); return serviceBuilder.install(); }