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 Details

    • ReflectiveOperationInvoker

      public ReflectiveOperationInvoker(Object target, OperationMethod operationMethod, ParameterValueMapper parameterValueMapper)
      Creates a new 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 Details

    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object