Package com.evolveum.midpoint.task.api
Interface RunningTask
-
- All Superinterfaces:
DebugDumpable
,IterativeOperationCollector
,MappingStatisticsCollector
,NotificationStatisticsCollector
,ObjectActionsCollector
,ProvisioningStatisticsCollector
,RunningTaskStatisticsCollector
,StatisticsCollector
,StructuredProgressCollector
,SynchronizationInformationCollector
,Task
- All Known Subinterfaces:
RunningLightweightTask
public interface RunningTask extends Task, RunningTaskStatisticsCollector
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRun()
Returns true if the task can run (was not interrupted).@NotNull RunningLightweightTask
createSubtask(@NotNull LightweightTaskHandler handler)
Creates a transient subtask, ready to execute a given LightweightTaskHandler.void
deleteLightweightAsynchronousSubtasks()
Precondition: there are no runnable nor running LATsint
getAndIncrementObjectsSeen()
Collection<? extends RunningLightweightTask>
getLightweightAsynchronousSubtasks()
@NotNull String
getRootTaskOid()
TODO EXPERIMENTALCollection<? extends RunningLightweightTask>
getRunnableOrRunningLightweightAsynchronousSubtasks()
Collection<? extends RunningLightweightTask>
getRunningLightweightAsynchronousSubtasks()
boolean
requestTracingIfNeeded(RunningTask coordinatorTask, int objectsSeen, TracingRootType defaultTracingRoot)
EXPERIMENTALvoid
startDynamicProfilingIfNeeded(RunningTask coordinatorTask, int objectsSeen)
Must be called from the thread that executes the task.void
stopDynamicProfiling()
Must be called from the thread that executes the task.void
stopTracing()
EXPERIMENTAL-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.schema.statistics.IterativeOperationCollector
getLastFailures, recordIterativeOperationStart, recordIterativeOperationStart, recordIterativeOperationStart, recordPartExecutionEnd, resetIterativeTaskInformation
-
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.schema.statistics.ObjectActionsCollector
markObjectActionExecutedBoundary, recordObjectActionExecuted, recordObjectActionExecuted, recordObjectActionExecuted, resetActionsExecutedInformation
-
Methods inherited from interface com.evolveum.midpoint.schema.statistics.ProvisioningStatisticsCollector
recordProvisioningOperation
-
Methods inherited from interface com.evolveum.midpoint.task.api.RunningTaskStatisticsCollector
incrementProgressAndStoreStatisticsIfTimePassed, refreshThreadLocalStatistics, setStatisticsRepoStoreInterval, startCollectingStatistics, storeStatisticsIntoRepository, storeStatisticsIntoRepositoryIfTimePassed, updateAndStoreStatisticsIntoRepository, updateStatisticsInTaskPrism
-
Methods inherited from interface com.evolveum.midpoint.schema.statistics.StatisticsCollector
recordStateMessage
-
Methods inherited from interface com.evolveum.midpoint.schema.statistics.StructuredProgressCollector
changeStructuredProgressOnWorkBucketCompletion, incrementStructuredProgress, markAllStructuredProgressClosed, markStructuredProgressAsComplete, setStructuredProgressPartInformation
-
Methods inherited from interface com.evolveum.midpoint.schema.statistics.SynchronizationInformationCollector
onSynchronizationExclusion, onSynchronizationSituationChange, onSynchronizationStart, onSyncItemProcessingEnd, onSyncItemProcessingStart, resetSynchronizationInformation
-
Methods inherited from interface com.evolveum.midpoint.task.api.Task
addArchetypeInformation, addArchetypeInformationIfMissing, addDependent, addExtensionProperty, addExtensionReference, addTracingRequest, createSubtask, deleteExtensionProperty, flushPendingModifications, getAggregatedLiveOperationStats, getBinding, getCachingProfiles, getCategory, getChannel, getCompletionTimestamp, getDependents, getDescription, getErrorHandlingStrategy, getExecutionConstraints, getExecutionEnvironment, getExecutionState, getExpectedTotal, getExtensionClone, getExtensionContainerRealValueOrClone, getExtensionItemOrClone, getExtensionOrClone, getExtensionPropertyOrClone, getExtensionPropertyRealValue, getExtensionReferenceOrClone, getGroup, getGroups, getGroupsWithLimits, getHandlerUri, getKind, getLastRunFinishTimestamp, getLastRunStartTimestamp, getModelOperationContext, getName, getNextRunStartTime, getNode, getNodeAsObserved, getObject, getObjectOid, getObjectRefOrClone, getOid, getOrCreateExtension, getOwner, getOwnerRef, getParent, getParentTask, getPathToRootTask, getPersistenceStatus, getPolicyRule, getProgress, getRawTaskObjectClone, getRawTaskObjectClonedIfNecessary, getRecurrence, getRequestee, getResult, getResultStatus, getSchedule, getScheduleInterval, getSchedulingState, getSelfReference, getStoredOperationStatsOrClone, getStructuredProgressOrClone, getTaskIdentifier, getThreadStopAction, getTracingProfile, getTracingRequestedFor, getUpdatedTaskObject, getVersion, getWaitingReason, getWorkManagement, getWorkState, hasAssignments, hasScheduleInterval, incrementProgressTransient, isAsynchronous, isClosed, isLooselyBound, isPersistent, isReady, isRecurring, isRunnable, isRunning, isScavenger, isSingle, isSuspended, isTightlyBound, isTransient, isWaiting, listDependents, listPrerequisiteTasks, listSubtasks, listSubtasks, listSubtasksDeeply, listSubtasksDeeply, makeSingle, makeSingle, modify, modify, refresh, removeTracingRequests, setCategory, setChannel, setDescription, setDescriptionImmediate, setExecutionConstraints, setExecutionEnvironment, setExpectedTotal, setExtensionContainer, setExtensionContainerValue, setExtensionItem, setExtensionProperty, setExtensionPropertyImmediate, setExtensionPropertyValue, setExtensionReference, setHandlerUri, setInitialExecutionAndScheduledState, setInitiallyRunnable, setInitiallySuspended, setInitiallyWaitingForPrerequisites, setModelOperationContext, setName, setName, setNameImmediate, setObjectRef, setObjectRef, setOwner, setOwnerRef, setProgress, setProgressImmediate, setRequesteeTransient, setResult, setThreadStopAction, setTracingProfile
-
-
-
-
Method Detail
-
canRun
boolean canRun()
Returns true if the task can run (was not interrupted). Will return false e.g. if shutdown was signaled. BEWARE: this flag is present only on the instance of the task that is being "executed", i.e. passed to task execution routine and task handler(s).- Returns:
- true if the task can run
-
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
-
getAndIncrementObjectsSeen
@Experimental int getAndIncrementObjectsSeen()
-
startDynamicProfilingIfNeeded
void startDynamicProfilingIfNeeded(RunningTask coordinatorTask, int objectsSeen)
Must be called from the thread that executes the task. EXPERIMENTAL; consider moving to AbstractSearchIterativeResultHandler
-
stopDynamicProfiling
void stopDynamicProfiling()
Must be called from the thread that executes the task.
-
requestTracingIfNeeded
boolean requestTracingIfNeeded(RunningTask coordinatorTask, int objectsSeen, TracingRootType defaultTracingRoot)
EXPERIMENTAL
-
stopTracing
void stopTracing()
EXPERIMENTAL
-
getRootTaskOid
@NotNull @NotNull String getRootTaskOid()
TODO EXPERIMENTAL
-
-