@Override
protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final org.jboss.as.controller.AbstractWriteAttributeHandler.HandbackHolder<Void> voidHandback) throws OperationFailedException {
final ServiceController<?> configService = context.getServiceRegistry(true).getService(WSServices.CONFIG_SERVICE);
if (configService != null) {
final ServerConfig config = (ServerConfig) configService.getValue();
final String value = resolvedValue.isDefined() ? resolvedValue.asString() : null;
if (MODIFY_WSDL_ADDRESS.equals(attributeName)) {
final boolean modifyWSDLAddress = value != null ? Boolean.parseBoolean(value) : false;
config.setModifySOAPAddress(modifyWSDLAddress);
} else if (WSDL_HOST.equals(attributeName)) {
final String host = value != null ? value : null;
try {
config.setWebServiceHost(host);
} catch (final Exception e) {
throw new OperationFailedException(e.getMessage(), e);
}
} else if (WSDL_PORT.equals(attributeName)) {
final int port = value != null ? Integer.parseInt(value) : -1;
config.setWebServicePort(port);
} else if (WSDL_SECURE_PORT.equals(attributeName)) {
final int securePort = value != null ? Integer.parseInt(value) : -1;
config.setWebServiceSecurePort(securePort);
}
}
return true;
}