org.springframework.boot.actuate.endpoint.invoke.reflect

Class ReflectiveOperationInvoker

  • java.lang.Object
    • org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker
  • All Implemented Interfaces:
    OperationInvoker


    public class ReflectiveOperationInvoker
    extends Object
    implements OperationInvoker
    An OperationInvoker that invokes an operation using reflection.
    Since:
    2.0.0
    Author:
    Andy Wilkinson, Stephane Nicoll, Phillip Webb
    • Constructor Detail

      • ReflectiveOperationInvoker

        public ReflectiveOperationInvoker(Object target,
                                          OperationMethod operationMethod,
                                          ParameterValueMapper parameterValueMapper)
        Creates a new {code ReflectiveOperationInvoker} that will invoke the given method on the given target. The given parameterMapper will be used to map parameters to the required types and the given parameterNameMapper will be used map parameters by name.
        Parameters:
        target - the target of the reflective call
        operationMethod - the method info
        parameterValueMapper - the parameter mapper
    • Method Detail

      • invoke

        public Object invoke(InvocationContext context)
        Description copied from interface: OperationInvoker
        Invoke the underlying operation using the given context.
        Specified by:
        invoke in interface OperationInvoker
        Parameters:
        context - the context to use to invoke the operation
        Returns:
        the result of the operation, may be null