Package com.evolveum.midpoint.task.api
Interface RunningTask
- All Superinterfaces:
CanRunSupplier
,ConnIdOperationsListener
,DebugDumpable
,MappingStatisticsCollector
,NotificationStatisticsCollector
,ProgressCollector
,RunningTaskStatisticsCollector
,StatisticsCollector
,Task
,TaskActionsExecutedCollector
,TaskIterativeOperationCollector
,TaskSynchronizationStatisticsCollector
- All Known Subinterfaces:
RunningLightweightTask
A task that is directly used to execute the handler code.
It is a very sensitive structure. First of all, it must be thread-safe because it is used for the handler code execution
and at the same time accessed by clients that need to check its state. There are two such situations:
(1) Lightweight Asynchronous Tasks because they have no persistent representation. The only instance that exists
is the one that is being executed by a handler.
(2) When a client asks the task manager for a current state of the task (typically being interested in operational stats).
The information could be fetched from the repository but it would be a bit outdated. This situation can be avoided
by retrieving information always from the repository, sacrificing information timeliness a bit. But the (1) cannot.
Some information related to task execution (e.g. list of lightweight asynchronous tasks, information on task thread, etc)
is relevant only for running tasks. Therefore they are moved here.
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
Fields inherited from interface com.evolveum.midpoint.task.api.Task
DOT_INTERFACE
-
Method Summary
Modifier and TypeMethodDescription@NotNull RunningLightweightTask
createSubtask
(@NotNull LightweightTaskHandler handler) Creates a transient subtask, ready to execute a given LightweightTaskHandler.void
Precondition: there are no runnable nor running LATsdefault @NotNull ExecutionModeType
Returns the execution mode (e.g.Collection<? extends RunningLightweightTask>
@Nullable Task
@NotNull Task
TODO EXPERIMENTAL@NotNull String
TODOCollection<? extends RunningLightweightTask>
Collection<? extends RunningLightweightTask>
boolean
void
makeWaitingForOtherTasks
(TaskExecutionStateType execState, TaskUnpauseActionType unpauseAction) Changes scheduling status to WAITING, and execution state to the given value.void
makeWaitingForOtherTasks
(TaskUnpauseActionType unpauseAction) Changes scheduling status to WAITING.void
setExcludedFromStalenessChecking
(boolean value) Sets the "excluded from staleness checking" flag.void
setExecutionSupport
(ExecutionSupport executionContext) Methods inherited from interface com.evolveum.midpoint.task.api.CanRunSupplier
canRun
Methods inherited from interface com.evolveum.midpoint.task.api.ConnIdOperationsListener
onConnIdOperationEnd, onConnIdOperationResume, onConnIdOperationStart, onConnIdOperationSuspend
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.schema.statistics.MappingStatisticsCollector
recordMappingOperation
Methods inherited from interface com.evolveum.midpoint.schema.statistics.NotificationStatisticsCollector
recordNotificationOperation
Methods inherited from interface com.evolveum.midpoint.task.api.RunningTaskStatisticsCollector
incrementLegacyProgressAndStoreStatisticsIfTimePassed, refreshThreadLocalStatistics, restartCollectingStatisticsFromZero, setStatisticsRepoStoreInterval, startCollectingStatistics, storeStatisticsIntoRepository, storeStatisticsIntoRepositoryIfTimePassed, updateAndStoreStatisticsIntoRepository, updateOperationStatsInTaskPrism
Methods inherited from interface com.evolveum.midpoint.schema.statistics.StatisticsCollector
recordStateMessage
Methods inherited from interface com.evolveum.midpoint.task.api.Task
addArchetypeInformation, addArchetypeInformationIfMissing, addDependent, addExtensionProperty, addExtensionReference, addTracingRequest, applyDeltasImmediate, applyModificationsTransient, areShadowChangesSimulated, assertPersistentExecution, canSee, canSee, canSee, createSubtask, deleteExtensionProperty, doesItemExist, flushPendingModifications, getActivitiesStateOrClone, getActivityStateOrClone, getActivityStateOrClone, getActivityTreeStateOverviewOrClone, getAggregatedLiveOperationStats, getBinding, getCachingProfiles, getChannel, getCleanupAfterCompletion, getCompletionTimestamp, getContainerableOrClone, getDependents, getDescription, getExecutionConstraints, getExecutionEnvironment, getExecutionMode, getExecutionState, getExpectedTotal, getExtensionClone, getExtensionContainerRealValueOrClone, getExtensionItemOrClone, getExtensionOrClone, getExtensionPropertyOrClone, getExtensionPropertyRealValue, getExtensionReferenceOrClone, getGroup, getGroups, getGroupsWithLimits, getHandlerUri, getItemRealValueOrClone, getLastRunFinishTimestamp, getLastRunStartTimestamp, getLegacyProgress, getName, getNextRunStartTime, getNode, getNodeAsObserved, getObject, getObjectOid, getObjectRefOrClone, getOid, getOrCreateExtension, getOwner, getOwnerRef, getParent, getParentAndRoot, getParentTask, getPathToRootTask, getPersistenceStatus, getPropertyRealValue, getPropertyRealValueOrClone, getRawTaskObjectClone, getRawTaskObjectClonedIfNecessary, getRecurrence, getReferenceRealValue, getReferenceRealValues, getRequestee, getResult, getResultStatus, getRoot, getRootActivityCompletionTimestamp, getRootActivityDefinitionOrClone, getSchedule, getScheduleInterval, getSchedulingState, getSelfReference, getSelfReferenceFull, getSimulationTransaction, getStoredOperationStatsOrClone, getTaskIdentifier, getThreadStopAction, getTracingProfile, getTracingRequestedFor, getUpdatedTaskObject, getVersion, getWaitingReason, getWorkState, hasAssignments, hasScheduleInterval, incrementLegacyProgressTransient, isAsynchronous, isClosed, isExecutionFullyPersistent, isIndestructible, isLooselyBound, isPersistent, isProductionConfiguration, isReady, isRecurring, isRoot, isRunnable, isRunning, isSingle, isSuspended, isTightlyBound, isTransient, isWaiting, listDependents, listPrerequisiteTasks, listSubtasks, listSubtasks, listSubtasksDeeply, listSubtasksDeeply, makeSingle, modify, modify, refresh, registerConnIdOperationsListener, removeTracingRequests, setChannel, setCleanupAfterCompletion, setDescription, setDescriptionImmediate, setExecutionConstraints, setExecutionEnvironment, setExecutionMode, setExpectedTotal, setExtensionContainer, setExtensionContainerValue, setExtensionItem, setExtensionProperty, setExtensionPropertyImmediate, setExtensionPropertyValue, setExtensionReference, setHandlerUri, setInitialExecutionAndScheduledState, setInitiallyRunnable, setInitiallySuspended, setInitiallyWaitingForPrerequisites, setItemRealValues, setItemRealValuesCollection, setLegacyProgress, setLegacyProgressImmediate, setName, setName, setNameImmediate, setObjectRef, setObjectRef, setOwner, setOwnerRef, setPropertyRealValue, setRequesteeTransient, setResult, setRootActivityDefinition, setSchedule, setSimulationTransaction, setThreadStopAction, setTracingProfile, unregisterConnIdOperationsListener
Methods inherited from interface com.evolveum.midpoint.schema.statistics.TaskActionsExecutedCollector
recordObjectActionExecuted, recordObjectActionExecuted, recordObjectActionExecuted, startCollectingActionsExecuted, stopCollectingActionsExecuted
Methods inherited from interface com.evolveum.midpoint.schema.statistics.TaskIterativeOperationCollector
recordIterativeOperationStart, recordIterativeOperationStart, recordIterativeOperationStart
Methods inherited from interface com.evolveum.midpoint.schema.statistics.TaskSynchronizationStatisticsCollector
onSynchronizationExclusion, onSynchronizationSituationChange, onSynchronizationStart, startCollectingSynchronizationStatistics, stopCollectingSynchronizationStatistics
-
Method Details
-
createSubtask
@NotNull @NotNull RunningLightweightTask createSubtask(@NotNull @NotNull LightweightTaskHandler handler) Creates a transient subtask, ready to execute a given LightweightTaskHandler. Owner is inherited from parent task to subtask. -
getLightweightAsynchronousSubtasks
Collection<? extends RunningLightweightTask> getLightweightAsynchronousSubtasks() -
getRunningLightweightAsynchronousSubtasks
Collection<? extends RunningLightweightTask> getRunningLightweightAsynchronousSubtasks() -
getRunnableOrRunningLightweightAsynchronousSubtasks
Collection<? extends RunningLightweightTask> getRunnableOrRunningLightweightAsynchronousSubtasks() -
deleteLightweightAsynchronousSubtasks
void deleteLightweightAsynchronousSubtasks()Precondition: there are no runnable nor running LATs -
getRootTaskOid
TODO -
getRootTask
TODO EXPERIMENTAL -
getParentTask
-
makeWaitingForOtherTasks
Changes scheduling status to WAITING. Does not change execution state. Currently use only on transient tasks OR from within task handler. -
makeWaitingForOtherTasks
void makeWaitingForOtherTasks(TaskExecutionStateType execState, TaskUnpauseActionType unpauseAction) Changes scheduling status to WAITING, and execution state to the given value. Currently use only on transient tasks OR from within task handler. -
getActivityExecutionMode
Returns the execution mode (e.g. execute, simulate, dry run) for the current operation. This is a little hack to avoid the need of passing this information throughout the whole call tree. (Originally this was implemented in task extension.) -
getExecutionSupport
ExecutionSupport getExecutionSupport()- Specified by:
getExecutionSupport
in interfaceTask
-
setExecutionSupport
-
isExcludedFromStalenessChecking
boolean isExcludedFromStalenessChecking()- Returns:
- True if this task should not be checked for staleness.
-
setExcludedFromStalenessChecking
void setExcludedFromStalenessChecking(boolean value) Sets the "excluded from staleness checking" flag.
-