Class ReflectiveOperationInvoker
- java.lang.Object
- org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker
- All Implemented Interfaces:
OperationInvoker
public class ReflectiveOperationInvoker extends Object implements OperationInvoker
AnOperationInvoker
that invokes an operation using reflection.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description ReflectiveOperationInvoker(Object target, OperationMethod operationMethod, ParameterValueMapper parameterValueMapper)
Creates a new {code ReflectiveOperationInvoker} that will invoke the givenmethod
on the giventarget
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
invoke(InvocationContext context)
Invoke the underlying operation using the givencontext
.String
toString()
Constructor Detail
ReflectiveOperationInvoker
public ReflectiveOperationInvoker(Object target, OperationMethod operationMethod, ParameterValueMapper parameterValueMapper)
Creates a new {code ReflectiveOperationInvoker} that will invoke the givenmethod
on the giventarget
. The givenparameterMapper
will be used to map parameters to the required types and the givenparameterNameMapper
will be used map parameters by name.- Parameters:
target
- the target of the reflective calloperationMethod
- the method infoparameterValueMapper
- the parameter mapper
Method Detail
invoke
public Object invoke(InvocationContext context)
Description copied from interface:OperationInvoker
Invoke the underlying operation using the givencontext
.- Specified by:
invoke
in interfaceOperationInvoker
- Parameters:
context
- the context to use to invoke the operation- Returns:
- the result of the operation, may be
null