installRuntimeServices(context, verificationHandler, newControllers);
}
void installRuntimeServices(final OperationContext context, ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException {
final RemoteNamingServerService remoteNamingServerService = new RemoteNamingServerService();
final ServiceBuilder<RemoteNamingService> builder = context.getServiceTarget().addService(RemoteNamingServerService.SERVICE_NAME, remoteNamingServerService);
if (verificationHandler != null) {
builder.addListener(verificationHandler);
}
final ServiceController<RemoteNamingService> controller = builder
.addDependency(RemotingServices.SUBSYSTEM_ENDPOINT, Endpoint.class, remoteNamingServerService.getEndpointInjector())
.addDependency(ContextNames.EXPORTED_CONTEXT_SERVICE_NAME, NamingStore.class, remoteNamingServerService.getNamingStoreInjector())
.addInjection(remoteNamingServerService.getExecutorServiceInjector(), Executors.newFixedThreadPool(10))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
if (newControllers != null) {
newControllers.add(controller);
}