com.amazonaws.services.simpleworkflow.flow.core

## クラス Task

- java.lang.Object
- - com.amazonaws.services.simpleworkflow.flow.core.Task

-     public abstract class Task
      extends java.lang.Object

  Asynchronous task that is executed when all `Promise`s passed to its constructor are ready (`null` parameter is considered ready).

  Should be created in the context of `AsyncScope.doAsync()` method, from `doExecute()` or from `TryCatchFinally` do... methods. Exceptions thrown from `doExecute()` are delivered asynchronously to the wrapping `TryCatchFinally.doCatch(Throwable)` method or rethrown from `AsyncScope.eventLoop()` if no wrapping `TryCatchFinally` is found.

  Example of using `Task` to implement asynchronous function that sums parameters when both of them are ready:

       public Promise<Integer> sum(Promise<Integer> a, Promise<Integer> b) {
           Settable<Integer> result = new Settable<Integer>();
           new Task(a, b) {
               public void doExecute() {
                   result.set(a.get() + b.get());
               }
           };
           return result;
       }

  関連項目:
    `AsyncScope`, `TryCatchFinally`, `Promise`

- - ### コンストラクタの概要

    コンストラクタ
    修飾子 | コンストラクタと説明
    --- | ---
    `` | `Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent, boolean daemon, Promise<?>... waitFor)`
    `protected` | `Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent, java.lang.Boolean daemon, java.lang.String parentTaskMethodName, boolean hideParentTaskMethodName, int skipStackLines, Promise<?>... waitFor)`
    `` | `Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent, Promise<?>... waitFor)`
    `` | `Task(boolean daemon, Promise<?>... waitFor)`
    `protected` | `Task(java.lang.Boolean daemon, java.lang.String parentTaskMethodName, boolean hideParentTaskMethodName, int skipStackLines, Promise<?>... waitFor)`
    `` | `Task(Promise<?>... waitFor)`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `protected abstract void` | `doExecute()`
    `java.lang.String` | `getName()`
    `java.lang.StackTraceElement[]` | `getStackTrace()`
    `void` | `setName(java.lang.String name)`
    `java.lang.String` | `toString()`

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### コンストラクタの詳細

    - #### Task

          public Task(Promise<?>... waitFor)

    - #### Task

          public Task(boolean daemon,
              Promise<?>... waitFor)

    - #### Task

          public Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent,
              boolean daemon,
              Promise<?>... waitFor)

    - #### Task

          public Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent,
              Promise<?>... waitFor)

    - #### Task

          protected Task(com.amazonaws.services.simpleworkflow.flow.core.AsyncContextAware parent,
              java.lang.Boolean daemon,
              java.lang.String parentTaskMethodName,
              boolean hideParentTaskMethodName,
              int skipStackLines,
              Promise<?>... waitFor)

    - #### Task

          protected Task(java.lang.Boolean daemon,
              java.lang.String parentTaskMethodName,
              boolean hideParentTaskMethodName,
              int skipStackLines,
              Promise<?>... waitFor)

  - ### メソッドの詳細

    - #### getName

          public java.lang.String getName()

    - #### setName

          public void setName(java.lang.String name)

    - #### getStackTrace

          public java.lang.StackTraceElement[] getStackTrace()

    - #### toString

          public java.lang.String toString()

      オーバーライド:
        `toString` クラス内 `java.lang.Object`

    - #### doExecute

          protected abstract void doExecute()
                                     throws java.lang.Throwable

      例外:
        `java.lang.Throwable`