use of org.springframework.boot.actuate.endpoint.InvalidEndpointRequestException in project spring-boot by spring-projects.
the class EndpointMBean method invoke.
private Object invoke(JmxOperation operation, Object[] params) throws MBeanException, ReflectionException {
try {
String[] parameterNames = operation.getParameters().stream().map(JmxOperationParameter::getName).toArray(String[]::new);
Map<String, Object> arguments = getArguments(parameterNames, params);
InvocationContext context = new InvocationContext(SecurityContext.NONE, arguments);
Object result = operation.invoke(context);
if (REACTOR_PRESENT) {
result = ReactiveHandler.handle(result);
}
return this.responseMapper.mapResponse(result);
} catch (InvalidEndpointRequestException ex) {
throw new ReflectionException(new IllegalArgumentException(ex.getMessage()), ex.getMessage());
} catch (Exception ex) {
throw new MBeanException(translateIfNecessary(ex), ex.getMessage());
}
}
Aggregations