if (configService != null) {
final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
final String name = address.getLastElement().getValue();
ServerConfig config = (ServerConfig) configService.getValue();
EndpointConfig endpointConfig = new EndpointConfig();
endpointConfig.setConfigName(name);
if (model.hasDefined(Constants.PRE_HANDLER_CHAINS)) {
ModelNode preHandlers = model.get(Constants.PRE_HANDLER_CHAINS);
endpointConfig.setPreHandlerChains(buildChainMD(preHandlers));
}
if (model.hasDefined(Constants.POST_HANDLER_CHAINS)) {
ModelNode postHandlers = model.get(Constants.POST_HANDLER_CHAINS);
endpointConfig.setPostHandlerChains(buildChainMD(postHandlers));
}
if (model.hasDefined(Constants.PROPERTY)) {
for (String key : model.get(Constants.PROPERTY).keys()) {
endpointConfig.setProperty(key, model.get(Constants.PROPERTY).get(key).asString());
}
}
if (model.hasDefined(Constants.FEATURE)) {
for (String key : model.get(Constants.FEATURE).keys()) {
endpointConfig.setFeature(new Feature(key), true);
}
}
config.addEndpointConfig(endpointConfig);
}
}