{
managementService.reloadExtensions();
rootResource = managementService.getManagedResource(PathAddress.empty());
}
PathAddress address = request.getAddress();
String operationName = request.getOperationName();
boolean debug = log.isDebugEnabled();
if (debug)
{
log.debug("Executing request for operation " + operationName + " at address " + address);
}
ManagedResource root = getRootResource();
if (root.getSubResource(address) == null)
{
throw new ResourceNotFoundException("Could not locate managed resource for address '" + address + "'");
}
OperationHandler operationHandler = root.getOperationHandler(address, operationName);
if (operationHandler != null)
{
// Obtain binding provider given managed component.
String componentName = (address.size() >= 1) ? address.get(0) : null;
BindingProvider bindingProvider = managementService.getBindingProvider(componentName);
// Execute operation for given registered operation handler
BasicResultHandler resultHandler = new BasicResultHandler();
operationHandler.execute(new OperationContextImpl(request, root, runtimeContext, bindingProvider), resultHandler);