Interface Task
- All Superinterfaces:
Cancelable
,Runnable
,SchedulingAwareRunnable
The actual
Task
to run within the MessageListenerContainer
.- Since:
- 2.1
- Author:
- Christoph Strobl
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
TheTask.State
defining the lifecycle phase the actualTask
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
awaitStart
(Duration timeout) Synchronous, blocking call that awaits until thisTask
becomes active.getState()
Get the current lifecycle phase.default boolean
isActive()
Methods inherited from interface org.springframework.data.mongodb.core.messaging.Cancelable
cancel
Methods inherited from interface org.springframework.scheduling.SchedulingAwareRunnable
getQualifier, isLongLived
-
Method Details
-
isActive
default boolean isActive()- Returns:
- true if the task is currently
running
.
-
getState
Task.State getState()Get the current lifecycle phase.- Returns:
- never null.
-
awaitStart
Synchronous, blocking call that awaits until thisTask
becomes active.- Parameters:
timeout
- must not be null.- Returns:
true
if the task was started.false
if the waiting time elapsed before task was started.- Throws:
InterruptedException
- if the current thread is interrupted while waiting.
-