additionalInit.setupController(controllerInitializer);
//Initialize the controller
ServiceContainer container = ServiceContainer.Factory.create("test" + counter.incrementAndGet());
ServiceTarget target = container.subTarget();
ControlledProcessState processState = new ControlledProcessState(true);
List<ModelNode> extraOps = controllerInitializer.initializeBootOperations();
List<ModelNode> allOps = new ArrayList<ModelNode>();
if (extraOps != null) {
allOps.addAll(extraOps);
}
allOps.addAll(bootOperations);
StringConfigurationPersister persister = new StringConfigurationPersister(allOps, testParser);
ModelControllerService svc = new ModelControllerService(additionalInit.getType(), mainExtension, controllerInitializer, additionalInit, processState, persister, additionalInit.isValidateOperations());
ServiceBuilder<ModelController> builder = target.addService(ServiceName.of("ModelController"), svc);
builder.install();
additionalInit.addExtraServices(target);
//sharedState = svc.state;
svc.latch.await();
ModelController controller = svc.getValue();
ModelNode setup = Util.getEmptyOperation("setup", new ModelNode());
controller.execute(setup, null, null, null);
processState.setRunning();
KernelServices kernelServices = new KernelServices(container, controller, persister, new OperationValidator(svc.rootRegistration));
this.kernelServices.add(kernelServices);
if (svc.error != null) {
throw svc.error;