Class ScheduledTaskObservationContext
java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.scheduling.support.ScheduledTaskObservationContext
- All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView
public class ScheduledTaskObservationContext
extends io.micrometer.observation.Observation.Context
Context that holds information for observation metadata collection during the
execution of scheduled tasks
.- Since:
- 6.1
- Author:
- Brian Clozel
-
Constructor Summary
ConstructorDescriptionScheduledTaskObservationContext
(Object target, Method method) Create a new observation context for a task, given the target object and the method to be called. -
Method Summary
Modifier and TypeMethodDescriptionReturn the method that is called for task execution.Class<?>
Return the type of the target object.boolean
Return whether the task execution is complete.void
setComplete
(boolean complete) Set whether the task execution has completed.Methods inherited from class io.micrometer.observation.Observation.Context
addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micrometer.observation.Observation.ContextView
getOrDefault
-
Constructor Details
-
ScheduledTaskObservationContext
Create a new observation context for a task, given the target object and the method to be called.- Parameters:
target
- the target object that is called for task executionmethod
- the method that is called for task execution
-
-
Method Details
-
getTargetClass
Return the type of the target object. -
getMethod
Return the method that is called for task execution. -
isComplete
public boolean isComplete()Return whether the task execution is complete.If an observation has ended and the task is not complete, this means that an
error
was raised or that the task execution got cancelled during its execution. -
setComplete
public void setComplete(boolean complete) Set whether the task execution has completed.
-