public void execute(RuntimeTaskContext context) throws OperationFailedException {
final ServiceTarget serviceTarget = context.getServiceTarget();
Logger.getLogger("org.jboss.as").infof("creating http management service using network interface (%s) port (%s)", interfaceName, port);
final HttpManagementService service = new HttpManagementService();
serviceTarget.addService(HttpManagementService.SERVICE_NAME, service)
.addDependency(
NetworkInterfaceService.JBOSS_NETWORK_INTERFACE.append(interfaceName),
NetworkInterfaceBinding.class, service.getInterfaceInjector())
.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector())
.addDependency(AbstractPathService.pathNameOf(ServerEnvironment.SERVER_TEMP_DIR), String.class, service.getTempDirInjector())
.addInjection(service.getPortInjector(), port)
.addInjection(service.getExecutorServiceInjector(), Executors.newCachedThreadPool(new JBossThreadFactory(new ThreadGroup("HttpManagementService-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext())))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
resultHandler.handleResultComplete();
}
});