All Superinterfaces:
Cancelable, Runnable, SchedulingAwareRunnable

public interface Task extends SchedulingAwareRunnable, Cancelable
The actual Task to run within the MessageListenerContainer.
Since:
2.1
Author:
Christoph Strobl
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The Task.State defining the lifecycle phase the actual Task.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Synchronous, blocking call that awaits until this Task becomes active.
    Get the current lifecycle phase.
    default boolean
     

    Methods inherited from interface org.springframework.data.mongodb.core.messaging.Cancelable

    cancel

    Methods inherited from interface java.lang.Runnable

    run

    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

      boolean awaitStart(Duration timeout) throws InterruptedException
      Synchronous, blocking call that awaits until this Task 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.