Class DecoratorAsyncHandle<T>

  • Type Parameters:
    T - result type of the async handle

    public class DecoratorAsyncHandle<T>
    extends AsyncHandle<T>
    Utility which decorates an existing async handle. Use as a base class and override just the methods you need to save some boilerplate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setError​(java.lang.RuntimeException error)
      Completes the invocation with an error.
      void setResult​(T result)
      Completes the invocation with an output value.
      void updateProgress​(DataValue progress)
      Reports progress for the operation invocation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DecoratorAsyncHandle

        public DecoratorAsyncHandle​(AsyncHandle<T> decorated)
        Creates a decorator around the specified handle.
        Parameters:
        decorated - handle to be decorated; must not be null.
    • Method Detail

      • updateProgress

        public void updateProgress​(DataValue progress)
        Description copied from class: AsyncHandle
        Reports progress for the operation invocation. May be invoked multiple times.
        Specified by:
        updateProgress in class AsyncHandle<T>
        Parameters:
        progress - progress status of the operation invocation
      • setResult

        public void setResult​(T result)
        Description copied from class: AsyncHandle
        Completes the invocation with an output value. Must not be called after the operation is already completed (with either an output or an error).
        Specified by:
        setResult in class AsyncHandle<T>
        Parameters:
        result - operation output
      • setError

        public void setError​(java.lang.RuntimeException error)
        Description copied from class: AsyncHandle
        Completes the invocation with an error. Must not be called after the operation is already completed (with either an output or an error).
        Specified by:
        setError in class AsyncHandle<T>
        Parameters:
        error - operation error