coldbox.system.async.tasks

Class FutureTask

lucee.Component
    extended by coldbox.system.async.tasks.FutureTask
Direct Known Subclasses:
ScheduledFuture

This is a ColdBox Future Task object modeled and backed by Java's Future interface but with Dynamic Goodness! This is the return of most of the executors when you send runnables to execute

Class Attributes:
  • synchronized : false
  •  
  • see : https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any native
          The native future we model: java.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init([any native])
          Build the ColdBox Future with the Java native class.
    Method Summary
    boolean cancel([boolean mayInterruptIfRunning='true'])
         If not already completed, completes this Future with a CancellationException.
    any get([numeric timeout='0'], [string timeUnit='milliseconds'], [any defaultValue])
         Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
    string getNative()
    boolean isCancelled()
         Returns true if this Future was cancelled before it completed normally.
    boolean isDone()
         Returns true if completed in any fashion: normally, exceptionally, or via cancellation.
    any setNative(any native)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any native])

    Build the ColdBox Future with the Java native class

    Parameters:
    native - The native Future class we are wrapping

    Property Detail

    native

    property any native

    The native future we model: java.util.concurrent.Future

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    cancel

    public boolean cancel([boolean mayInterruptIfRunning='true'])

    If not already completed, completes this Future with a CancellationException. Dependent Futures that have not already completed will also complete exceptionally, with a CompletionException caused by this CancellationException.

    Parameters:
    mayInterruptIfRunning
    Returns:
    true if this task is now cancelled

    get

    public any get([numeric timeout='0'], [string timeUnit='milliseconds'], [any defaultValue])

    Waits if necessary for at most the given time for this future to complete, and then returns its result, if available. If the result is null, then you can pass the defaultValue argument to return it.

    Parameters:
    timeout - The timeout value to use, defaults to forever
    timeUnit - The time unit to use, available units are: days, hours, microseconds, milliseconds, minutes, nanoseconds, and seconds. The default is milliseconds
    defaultValue - If the Future did not produce a value, then it will return this default value.
    Returns:
    The result value
    Throws:
    CancellationException , ExecutionException, InterruptedException, TimeoutException

    getNative

    public string getNative()


    isCancelled

    public boolean isCancelled()

    Returns true if this Future was cancelled before it completed normally.


    isDone

    public boolean isDone()

    Returns true if completed in any fashion: normally, exceptionally, or via cancellation.


    setNative

    public any setNative(any native)

    Parameters:
    native