Class InvocationContext
java.lang.Object
org.springframework.boot.actuate.endpoint.InvocationContext
The context for the
invocation of an operation.- Since:
- 2.0.0
- Author:
- Andy Wilkinson, Phillip Webb
-
Constructor Summary
ConstructorsConstructorDescriptionInvocationContext(SecurityContext securityContext, Map<String, Object> arguments, OperationArgumentResolver... argumentResolvers) Creates a new context for an operation being invoked by the givensecurityContextwith the given availablearguments. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanResolve(Class<?> type) Returns whether or not the context is capable of resolving an argument of the giventype.Return the invocation arguments.<T> TresolveArgument(Class<T> argumentType) Resolves an argument with the givenargumentType.
-
Constructor Details
-
InvocationContext
public InvocationContext(SecurityContext securityContext, Map<String, Object> arguments, OperationArgumentResolver... argumentResolvers) Creates a new context for an operation being invoked by the givensecurityContextwith the given availablearguments.- Parameters:
securityContext- the current security context. Nevernullarguments- the arguments available to the operation. NevernullargumentResolvers- resolvers for additional arguments should be available to the operation.
-
-
Method Details
-
getArguments
Return the invocation arguments.- Returns:
- the arguments
-
resolveArgument
Resolves an argument with the givenargumentType.- 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
Returns whether or not the context is capable of resolving an argument of the giventype. Note that, even whentrueis returned,argument resolutionwill returnnullif no argument of the required type is available.- Parameters:
type- argument type- Returns:
trueif resolution of arguments of the given type is possible, otherwisefalse.- Since:
- 2.5.0
- See Also:
-