Top Description Fields Constructors Methods
org.springframework.scheduling.support

public Class ScheduledTaskObservationContext

extends Context
Class Inheritance
Imports
java.lang.reflect.Method, io.micrometer.observation.Observation, org.springframework.util.ClassUtils

Context that holds information for observation metadata collection during the execution of scheduled tasks.
Author
Brian Clozel
Since
6.1

Field Summary

Modifier and TypeField and Description
private boolean
private final Method
private final Class<?>

Constructor Summary

AccessConstructor and Description
public
ScheduledTaskObservationContext(Object
the target object that is called for task execution
target
,
Method
the method that is called for task execution
method
)

Create a new observation context for a task, given the target object and the method to be called.

Method Summary

Modifier and TypeMethod and Description
public Method
getMethod()

Return the method that is called for task execution.

public Class<?>
getTargetClass()

Return the type of the target object.

public boolean
isComplete()

Return whether the task execution is complete.

public void
setComplete(boolean complete)

Set whether the task execution has completed.

Inherited from io.micrometer.observation.Observation.Context:
addHighCardinalityKeyValueaddHighCardinalityKeyValuesaddLowCardinalityKeyValueaddLowCardinalityKeyValuesclearcomputeIfAbsentcontainsKeygetgetAllKeyValuesgetContextualNamegetErrorgetHighCardinalityKeyValuegetHighCardinalityKeyValuesgetLowCardinalityKeyValuegetLowCardinalityKeyValuesgetNamegetOrDefaultgetParentObservationgetRequiredputremoveremoveHighCardinalityKeyValueremoveHighCardinalityKeyValuesremoveLowCardinalityKeyValueremoveLowCardinalityKeyValuessetContextualNamesetErrorsetNamesetParentObservationtoString

Field Detail

completeback to summary
private boolean complete
methodback to summary
private final Method method
targetClassback to summary
private final Class<?> targetClass

Constructor Detail

ScheduledTaskObservationContextback to summary
public ScheduledTaskObservationContext(Object target, Method method)

Create a new observation context for a task, given the target object and the method to be called.

Parameters
target:Object

the target object that is called for task execution

method:Method

the method that is called for task execution

Method Detail

getMethodback to summary
public Method getMethod()

Return the method that is called for task execution.

getTargetClassback to summary
public Class<?> getTargetClass()

Return the type of the target object.

isCompleteback to summary
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.

setCompleteback to summary
public void setComplete(boolean complete)

Set whether the task execution has completed.