Class InvocationContext

java.lang.Object
org.springframework.boot.actuate.endpoint.InvocationContext

public class InvocationContext extends Object
The context for the invocation of an operation.
Since:
2.0.0
Author:
Andy Wilkinson, Phillip Webb
  • Constructor Details

    • InvocationContext

      public InvocationContext(SecurityContext securityContext, Map<String,Object> arguments, OperationArgumentResolver... argumentResolvers)
      Creates a new context for an operation being invoked by the given securityContext with the given available arguments.
      Parameters:
      securityContext - the current security context. Never null
      arguments - the arguments available to the operation. Never null
      argumentResolvers - resolvers for additional arguments should be available to the operation.
  • Method Details

    • getArguments

      public Map<String,Object> getArguments()
      Return the invocation arguments.
      Returns:
      the arguments
    • resolveArgument

      public <T> T resolveArgument(Class<T> argumentType)
      Resolves an argument with the given argumentType.
      Type Parameters:
      T - type of the argument
      Parameters:
      argumentType - type of the argument
      Returns:
      resolved argument of the required type or null
      Since:
      2.5.0
      See Also:
    • canResolve

      public boolean canResolve(Class<?> type)
      Returns whether or not the context is capable of resolving an argument of the given type. Note that, even when true is returned, argument resolution will return null if no argument of the required type is available.
      Parameters:
      type - argument type
      Returns:
      true if resolution of arguments of the given type is possible, otherwise false.
      Since:
      2.5.0
      See Also: