static void installNativeManagementConnector(final OperationContext context, final ModelNode model, final ServiceName endpointName, final ServiceTarget serviceTarget,
final ServiceVerificationHandler verificationHandler,
final List<ServiceController<?>> newControllers) throws OperationFailedException {
ServiceName socketBindingServiceName = null;
ServiceName interfaceSvcName = null;
int port = 0;
final ModelNode socketBindingNode = validateResolvedModel(SOCKET_BINDING, context, model);
if (socketBindingNode.isDefined()) {
final String bindingName = SOCKET_BINDING.resolveModelAttribute(context, model).asString();
socketBindingServiceName = SocketBinding.JBOSS_BINDING_NAME.append(bindingName);
} else {
String interfaceName = INTERFACE.resolveModelAttribute(context, model).asString();
interfaceSvcName = NetworkInterfaceService.JBOSS_NETWORK_INTERFACE.append(interfaceName);
port = NATIVE_PORT.resolveModelAttribute(context, model).asInt();
}
ServiceName realmSvcName = null;
final ModelNode realmNode = SECURITY_REALM.resolveModelAttribute(context, model);
if (realmNode.isDefined()) {
realmSvcName = SecurityRealmService.BASE_SERVICE_NAME.append(realmNode.asString());
} else {
Logger.getLogger("org.jboss.as").warn("No security realm defined for native management service, all access will be unrestricted.");
}
ServiceName tmpDirPath = ServiceName.JBOSS.append("server", "path", "jboss.server.temp.dir");
RemotingServices.installSecurityServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_CONNECTOR, realmSvcName, null, tmpDirPath, verificationHandler, newControllers);
if (socketBindingServiceName == null) {
ManagementRemotingServices.installConnectorServicesForNetworkInterfaceBinding(serviceTarget, endpointName,
ManagementRemotingServices.MANAGEMENT_CONNECTOR, interfaceSvcName, port, OptionMap.EMPTY, verificationHandler, newControllers);
} else {