final SecurityRealmService securityRealmService = securityRealmServiceValue.getOptionalValue();
InetSocketAddress bindAddress = null;
InetSocketAddress secureBindAddress = null;
SocketBinding basicBinding = injectedSocketBindingValue.getOptionalValue();
SocketBinding secureBinding = injectedSecureSocketBindingValue.getOptionalValue();
final NetworkInterfaceBinding interfaceBinding = interfaceBindingValue.getOptionalValue();
if (interfaceBinding != null) {
useUnmanagedBindings = true;
final int port = portValue.getOptionalValue();
if (port > 0) {
bindAddress = new InetSocketAddress(interfaceBinding.getAddress(), port);
}
final int securePort = securePortValue.getOptionalValue();
if (securePort > 0) {
secureBindAddress = new InetSocketAddress(interfaceBinding.getAddress(), securePort);
}
} else {
if (basicBinding != null) {
bindAddress = basicBinding.getSocketAddress();
}
if (secureBinding != null) {
secureBindAddress = secureBinding.getSocketAddress();
}
}
try {
serverManagement = ManagementHttpServer.create(bindAddress, secureBindAddress, 50, modelControllerClient,