com.amazonaws.services.simpleworkflow.flow.worker

## クラス GenericWorker

- java.lang.Object
- - com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker

- すべての実装されたインタフェース:
    Suspendable, SuspendableWorker, WorkerBase, WorkerLifecycle
  直系の既知のサブクラス:
    GenericActivityWorker, GenericWorkflowWorker

      public abstract class GenericWorker
      extends java.lang.Object
      implements WorkerBase

- - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `protected java.lang.String` | `domain`
    `protected long` | `domainRetentionPeriodInDays`
    `protected static int` | `MAX_IDENTITY_LENGTH`
    `protected boolean` | `registerDomain`
    `protected AmazonSimpleWorkflow` | `service`
    `protected java.util.concurrent.atomic.AtomicReference<java.util.concurrent.CountDownLatch>` | `suspendLatch`
    `protected java.lang.Thread.UncaughtExceptionHandler` | `uncaughtExceptionHandler`

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

    コンストラクタ
    コンストラクタと説明
    `GenericWorker()`
    `GenericWorker(AmazonSimpleWorkflow service, java.lang.String domain, java.lang.String taskListToPoll)`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `boolean` | `awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)`
    `protected void` | `checkRequiredProperty(java.lang.Object value, java.lang.String name)`
    `protected abstract void` | `checkRequredProperties()`
    `protected void` | `checkStarted()`
    `protected abstract TaskPoller` | `createPoller()`
    `java.lang.String` | `getDomain()`
    `long` | `getDomainRetentionPeriodInDays()`
    `java.lang.String` | `getIdentity()`
    `int` | `getMaximumPollRateIntervalMilliseconds()`
    `double` | `getMaximumPollRatePerSecond()`
    `double` | `getPollBackoffCoefficient()`
    `long` | `getPollBackoffInitialInterval()`
    `long` | `getPollBackoffMaximumInterval()`
    `int` | `getPollThreadCount()`
    `protected abstract java.lang.String` | `getPollThreadNamePrefix()`
    `AmazonSimpleWorkflow` | `getService()`
    `java.lang.String` | `getTaskListToPoll()` Task list name that given worker polls for tasks.
    `java.lang.Thread.UncaughtExceptionHandler` | `getUncaughtExceptionHandler()`
    `boolean` | `isDisableServiceShutdownOnStop()`
    `boolean` | `isDisableTypeRegistrationOnStart()`
    `boolean` | `isRegisterDomain()`
    `boolean` | `isRunning()`
    `void` | `resumePolling()` Allow new poll requests.
    `void` | `setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)` By default when @{link `shutdown()` or @{link `shutdownNow()` is called the worker calls `AmazonSimpleWorkflow.shutdown()` on the service instance it is configured with before shutting down internal thread pools.
    `void` | `setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)` When set to true disables types registration on start even if `SkipTypeRegistration` is not specified.
    `void` | `setDomain(java.lang.String domain)`
    `void` | `setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays)` Value of DomainRetentionPeriodInDays parameter passed to `AmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest)` call.
    `void` | `setIdentity(java.lang.String identity)` Set the identity that worker specifies in the poll requests.
    `void` | `setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)` The sliding window interval used to measure the poll rate.
    `void` | `setMaximumPollRatePerSecond(double maximumPollRatePerSecond)` Maximum number of poll request to the task list per second allowed.
    `void` | `setPollBackoffCoefficient(double backoffCoefficient)`
    `void` | `setPollBackoffInitialInterval(long backoffInitialInterval)` Failed poll requests are retried after an interval defined by an exponential backoff algorithm.
    `void` | `setPollBackoffMaximumInterval(long backoffMaximumInterval)`
    `void` | `setPollThreadCount(int threadCount)` Defines how many concurrent threads are used by the given worker to poll the specified task list.
    `void` | `setRegisterDomain(boolean registerDomain)` Should domain be registered on startup.
    `void` | `setService(AmazonSimpleWorkflow service)`
    `void` | `setTaskListToPoll(java.lang.String taskListToPoll)`
    `void` | `setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)` Handler notified about poll request and other unexpected failures.
    `void` | `shutdown()`
    `boolean` | `shutdownAndAwaitTermination(long timeout, java.util.concurrent.TimeUnit unit)`
    `void` | `shutdownNow()`
    `void` | `start()`
    `void` | `suspendPolling()` Do not make new poll requests.
    `java.lang.String` | `toString()`

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

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

    - ### インタフェースから継承されたメソッド com.amazonaws.services.simpleworkflow.flow.WorkerBase

      `registerTypesToPoll`

- - ### フィールドの詳細

    - #### MAX_IDENTITY_LENGTH

          protected static final int MAX_IDENTITY_LENGTH

      関連項目:
        定数フィールド値

    - #### service

          protected AmazonSimpleWorkflow service

    - #### domain

          protected java.lang.String domain

    - #### registerDomain

          protected boolean registerDomain

    - #### domainRetentionPeriodInDays

          protected long domainRetentionPeriodInDays

    - #### suspendLatch

          protected final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.CountDownLatch> suspendLatch

    - #### uncaughtExceptionHandler

          protected java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler

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

    - #### GenericWorker

          public GenericWorker(AmazonSimpleWorkflow service,
                       java.lang.String domain,
                       java.lang.String taskListToPoll)

    - #### GenericWorker

          public GenericWorker()

  - ### メソッドの詳細

    - #### getService

          public AmazonSimpleWorkflow getService()

      定義:
        `getService` インタフェース内 `WorkerBase`

    - #### setService

          public void setService(AmazonSimpleWorkflow service)

    - #### getDomain

          public java.lang.String getDomain()

      定義:
        `getDomain` インタフェース内 `WorkerBase`

    - #### setDomain

          public void setDomain(java.lang.String domain)

    - #### isRegisterDomain

          public boolean isRegisterDomain()

      定義:
        `isRegisterDomain` インタフェース内 `WorkerBase`

    - #### setRegisterDomain

          public void setRegisterDomain(boolean registerDomain)

      Should domain be registered on startup. Default is `false`. When enabled `#setDomainRetentionPeriodInDays(Long)` property is required.
      定義:
        `setRegisterDomain` インタフェース内 `WorkerBase`

    - #### getDomainRetentionPeriodInDays

          public long getDomainRetentionPeriodInDays()

      定義:
        `getDomainRetentionPeriodInDays` インタフェース内 `WorkerBase`

    - #### setDomainRetentionPeriodInDays

          public void setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays)

      インタフェースからコピーされた説明: `WorkerBase`
      Value of DomainRetentionPeriodInDays parameter passed to `AmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest)` call. Required when `WorkerBase.isRegisterDomain()` is `true`.
      定義:
        `setDomainRetentionPeriodInDays` インタフェース内 `WorkerBase`

    - #### getTaskListToPoll

          public java.lang.String getTaskListToPoll()

      インタフェースからコピーされた説明: `WorkerBase`
      Task list name that given worker polls for tasks.
      定義:
        `getTaskListToPoll` インタフェース内 `WorkerBase`

    - #### setTaskListToPoll

          public void setTaskListToPoll(java.lang.String taskListToPoll)

    - #### getMaximumPollRatePerSecond

          public double getMaximumPollRatePerSecond()

      定義:
        `getMaximumPollRatePerSecond` インタフェース内 `WorkerBase`

    - #### setMaximumPollRatePerSecond

          public void setMaximumPollRatePerSecond(double maximumPollRatePerSecond)

      インタフェースからコピーされた説明: `WorkerBase`
      Maximum number of poll request to the task list per second allowed. Default is 0 which means unlimited.
      定義:
        `setMaximumPollRatePerSecond` インタフェース内 `WorkerBase`
      関連項目:
        `WorkerBase.setMaximumPollRateIntervalMilliseconds(int)`

    - #### getMaximumPollRateIntervalMilliseconds

          public int getMaximumPollRateIntervalMilliseconds()

      定義:
        `getMaximumPollRateIntervalMilliseconds` インタフェース内 `WorkerBase`

    - #### setMaximumPollRateIntervalMilliseconds

          public void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)

      インタフェースからコピーされた説明: `WorkerBase`
      The sliding window interval used to measure the poll rate. Controls allowed rate burstiness. For example if allowed rate is 10 per second and poll rate interval is 100 milliseconds the poller is not going to allow more then one poll per 100 milliseconds. If poll rate interval is 10 seconds then 100 request can be emitted as fast as possible, but then the polling stops until 10 seconds pass.
      定義:
        `setMaximumPollRateIntervalMilliseconds` インタフェース内 `WorkerBase`
      関連項目:
        `WorkerBase.setMaximumPollRatePerSecond(double)`

    - #### getUncaughtExceptionHandler

          public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()

      定義:
        `getUncaughtExceptionHandler` インタフェース内 `WorkerBase`

    - #### setUncaughtExceptionHandler

          public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)

      インタフェースからコピーされた説明: `WorkerBase`
      Handler notified about poll request and other unexpected failures. The default implementation logs the failures using ERROR level.
      定義:
        `setUncaughtExceptionHandler` インタフェース内 `WorkerBase`

    - #### getIdentity

          public java.lang.String getIdentity()

      定義:
        `getIdentity` インタフェース内 `WorkerBase`

    - #### setIdentity

          public void setIdentity(java.lang.String identity)

      インタフェースからコピーされた説明: `WorkerBase`
      Set the identity that worker specifies in the poll requests. This value ends up stored in the identity field of the corresponding Start history event. Default is "pid"@"host".
      定義:
        `setIdentity` インタフェース内 `WorkerBase`
      パラメータ:
        `identity` - maximum size is 256 characters.

    - #### getPollBackoffInitialInterval

          public long getPollBackoffInitialInterval()

      定義:
        `getPollBackoffInitialInterval` インタフェース内 `WorkerBase`

    - #### setPollBackoffInitialInterval

          public void setPollBackoffInitialInterval(long backoffInitialInterval)

      インタフェースからコピーされた説明: `WorkerBase`
      Failed poll requests are retried after an interval defined by an exponential backoff algorithm. See BackoffThrottler for more info.
      定義:
        `setPollBackoffInitialInterval` インタフェース内 `WorkerBase`
      パラメータ:
        `backoffInitialInterval` - the interval between failure and the first retry. Default is 100.

    - #### getPollBackoffMaximumInterval

          public long getPollBackoffMaximumInterval()

      定義:
        `getPollBackoffMaximumInterval` インタフェース内 `WorkerBase`

    - #### setPollBackoffMaximumInterval

          public void setPollBackoffMaximumInterval(long backoffMaximumInterval)

      定義:
        `setPollBackoffMaximumInterval` インタフェース内 `WorkerBase`
      パラメータ:
        `backoffMaximumInterval` - maximum interval between poll request retries. Default is 60000 (one minute).
      関連項目:
        `WorkerBase.setPollBackoffInitialInterval(long)`

    - #### isDisableServiceShutdownOnStop

          public boolean isDisableServiceShutdownOnStop()

      定義:
        `isDisableServiceShutdownOnStop` インタフェース内 `WorkerBase`
      関連項目:
        `setDisableServiceShutdownOnStop(boolean)`

    - #### setDisableServiceShutdownOnStop

          public void setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)

      By default when @{link `shutdown()` or @{link `shutdownNow()` is called the worker calls `AmazonSimpleWorkflow.shutdown()` on the service instance it is configured with before shutting down internal thread pools. Otherwise threads that are waiting on a poll request might block shutdown for the duration of a poll. This flag allows disabling this behavior.
      定義:
        `setDisableServiceShutdownOnStop` インタフェース内 `WorkerBase`
      パラメータ:
        `disableServiceShutdownOnStop` - `true` means do not call `AmazonSimpleWorkflow.shutdown()`

    - #### getPollBackoffCoefficient

          public double getPollBackoffCoefficient()

      定義:
        `getPollBackoffCoefficient` インタフェース内 `WorkerBase`

    - #### setPollBackoffCoefficient

          public void setPollBackoffCoefficient(double backoffCoefficient)

      定義:
        `setPollBackoffCoefficient` インタフェース内 `WorkerBase`
      パラメータ:
        `backoffCoefficient` - coefficient that defines how fast retry interval grows in case of poll request failures. Default is 2.0.
      関連項目:
        `WorkerBase.setPollBackoffInitialInterval(long)`

    - #### getPollThreadCount

          public int getPollThreadCount()

      定義:
        `getPollThreadCount` インタフェース内 `WorkerBase`

    - #### setPollThreadCount

          public void setPollThreadCount(int threadCount)

      インタフェースからコピーされた説明: `WorkerBase`
      Defines how many concurrent threads are used by the given worker to poll the specified task list. Default is 1. Note that in case of `ActivityWorker` two separate threads pools are used. One for polling and another one for executing activities. The size of the activity execution thread pool is defined through `ActivityWorker.setTaskExecutorThreadPoolSize(int)`.
      定義:
        `setPollThreadCount` インタフェース内 `WorkerBase`

    - #### setDisableTypeRegistrationOnStart

          public void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)

      インタフェースからコピーされた説明: `WorkerBase`
      When set to true disables types registration on start even if `SkipTypeRegistration` is not specified. Types still can be registered by calling `WorkerBase.registerTypesToPoll()`.
      定義:
        `setDisableTypeRegistrationOnStart` インタフェース内 `WorkerBase`

    - #### isDisableTypeRegistrationOnStart

          public boolean isDisableTypeRegistrationOnStart()

      定義:
        `isDisableTypeRegistrationOnStart` インタフェース内 `WorkerBase`

    - #### start

          public void start()

      定義:
        `start` インタフェース内 `WorkerLifecycle`

    - #### getPollThreadNamePrefix

          protected abstract java.lang.String getPollThreadNamePrefix()

    - #### createPoller

          protected abstract TaskPoller createPoller()

    - #### checkRequredProperties

          protected abstract void checkRequredProperties()

    - #### checkRequiredProperty

          protected void checkRequiredProperty(java.lang.Object value,
                                   java.lang.String name)

    - #### checkStarted

          protected void checkStarted()

    - #### shutdown

          public void shutdown()

      定義:
        `shutdown` インタフェース内 `WorkerLifecycle`

    - #### shutdownNow

          public void shutdownNow()

      定義:
        `shutdownNow` インタフェース内 `WorkerLifecycle`

    - #### awaitTermination

          public boolean awaitTermination(long timeout,
                                 java.util.concurrent.TimeUnit unit)
                                   throws java.lang.InterruptedException

      定義:
        `awaitTermination` インタフェース内 `WorkerLifecycle`
      例外:
        `java.lang.InterruptedException`

    - #### shutdownAndAwaitTermination

          public boolean shutdownAndAwaitTermination(long timeout,
                                            java.util.concurrent.TimeUnit unit)
                                              throws java.lang.InterruptedException

      定義:
        `shutdownAndAwaitTermination` インタフェース内 `WorkerLifecycle`
      例外:
        `java.lang.InterruptedException`

    - #### toString

          public java.lang.String toString()

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

    - #### isRunning

          public boolean isRunning()

      定義:
        `isRunning` インタフェース内 `WorkerBase`

    - #### suspendPolling

          public void suspendPolling()

      インタフェースからコピーされた説明: `Suspendable`
      Do not make new poll requests. Outstanding long polls still can return tasks after this method was called.
      定義:
        `suspendPolling` インタフェース内 `Suspendable`

    - #### resumePolling

          public void resumePolling()

      インタフェースからコピーされた説明: `Suspendable`
      Allow new poll requests.
      定義:
        `resumePolling` インタフェース内 `Suspendable`