public class ActivityWorker extends java.lang.Object implements WorkerBase
| コンストラクタと説明 |
|---|
ActivityWorker(AmazonSimpleWorkflow service,
java.lang.String domain,
java.lang.String taskListToPoll) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
java.util.List<ActivityType> |
addActivitiesImplementation(java.lang.Object activitiesImplementation) |
java.util.List<ActivityType> |
addActivitiesImplementation(java.lang.Object activitiesImplementation,
DataConverter converter) |
java.util.List<ActivityType> |
addActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations) |
java.util.List<ActivityType> |
addActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations,
DataConverter dataConverter) |
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
java.lang.Iterable<java.lang.Object> |
getActivitiesImplementations() |
ActivityImplementation |
getActivityImplementation(ActivityType activityType) |
java.lang.Iterable<ActivityType> |
getActivityTypesToRegister() |
DataConverter |
getDataConverter() |
java.lang.String |
getDomain() |
long |
getDomainRetentionPeriodInDays() |
java.lang.String |
getIdentity() |
int |
getMaximumPollRateIntervalMilliseconds() |
double |
getMaximumPollRatePerSecond() |
double |
getPollBackoffCoefficient() |
long |
getPollBackoffInitialInterval() |
long |
getPollBackoffMaximumInterval() |
int |
getPollThreadCount() |
AmazonSimpleWorkflow |
getService() |
int |
getTaskExecutorThreadPoolSize() |
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 |
registerTypesToPoll()
Try to register every type (activity or workflow depending on worker)
that are configured with the worker.
|
void |
resumePolling()
Allow new poll requests.
|
void |
setActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations) |
void |
setDataConverter(DataConverter dataConverter) |
void |
setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)
When set to false (which is default) at the beginning of the worker
shutdown
AmazonSimpleWorkflow.shutdown() is called. |
void |
setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)
When set to true disables types registration on start even if
SkipTypeRegistration is not specified. |
void |
setDomainRetentionPeriodInDays(long days)
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 |
setTaskExecutorThreadPoolSize(int taskExecutorThreadPoolSize) |
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() |
public ActivityWorker(AmazonSimpleWorkflow service, java.lang.String domain, java.lang.String taskListToPoll)
public void setActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.SecurityException,
java.lang.NoSuchMethodException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic java.lang.Iterable<java.lang.Object> getActivitiesImplementations()
public java.util.List<ActivityType> addActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic java.util.List<ActivityType> addActivitiesImplementations(java.lang.Iterable<java.lang.Object> activitiesImplementations, DataConverter dataConverter) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic java.util.List<ActivityType> addActivitiesImplementation(java.lang.Object activitiesImplementation) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic java.util.List<ActivityType> addActivitiesImplementation(java.lang.Object activitiesImplementation, DataConverter converter) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.SecurityException, java.lang.NoSuchMethodException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.SecurityExceptionjava.lang.NoSuchMethodExceptionpublic java.lang.Iterable<ActivityType> getActivityTypesToRegister()
public ActivityImplementation getActivityImplementation(ActivityType activityType)
public DataConverter getDataConverter()
public void setDataConverter(DataConverter dataConverter)
public int getTaskExecutorThreadPoolSize()
public void setTaskExecutorThreadPoolSize(int taskExecutorThreadPoolSize)
public boolean shutdownAndAwaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
shutdownAndAwaitTermination インタフェース内 WorkerLifecyclejava.lang.InterruptedExceptionpublic void shutdownNow()
shutdownNow インタフェース内 WorkerLifecyclepublic AmazonSimpleWorkflow getService()
getService インタフェース内 WorkerBasepublic java.lang.String getDomain()
getDomain インタフェース内 WorkerBasepublic boolean isRegisterDomain()
isRegisterDomain インタフェース内 WorkerBasepublic boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
awaitTermination インタフェース内 WorkerLifecyclejava.lang.InterruptedExceptionpublic void setRegisterDomain(boolean registerDomain)
WorkerBasefalse.
When enabled #setDomainRetentionPeriodInDays(Long) property is
required.setRegisterDomain インタフェース内 WorkerBasepublic long getDomainRetentionPeriodInDays()
getDomainRetentionPeriodInDays インタフェース内 WorkerBasepublic void setDomainRetentionPeriodInDays(long days)
WorkerBaseAmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest) call. Required when
WorkerBase.isRegisterDomain() is true.setDomainRetentionPeriodInDays インタフェース内 WorkerBasepublic java.lang.String getTaskListToPoll()
WorkerBasegetTaskListToPoll インタフェース内 WorkerBasepublic double getMaximumPollRatePerSecond()
getMaximumPollRatePerSecond インタフェース内 WorkerBasepublic void setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
WorkerBasepublic int getMaximumPollRateIntervalMilliseconds()
getMaximumPollRateIntervalMilliseconds インタフェース内 WorkerBasepublic void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
WorkerBasepublic java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
getUncaughtExceptionHandler インタフェース内 WorkerBasepublic void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
WorkerBasesetUncaughtExceptionHandler インタフェース内 WorkerBasepublic java.lang.String getIdentity()
getIdentity インタフェース内 WorkerBasepublic void setIdentity(java.lang.String identity)
WorkerBasesetIdentity インタフェース内 WorkerBaseidentity - maximum size is 256 characters.public long getPollBackoffInitialInterval()
getPollBackoffInitialInterval インタフェース内 WorkerBasepublic void setPollBackoffInitialInterval(long backoffInitialInterval)
WorkerBasesetPollBackoffInitialInterval インタフェース内 WorkerBasebackoffInitialInterval - the interval between failure and the first retry. Default is
100.public long getPollBackoffMaximumInterval()
getPollBackoffMaximumInterval インタフェース内 WorkerBasepublic void setPollBackoffMaximumInterval(long backoffMaximumInterval)
setPollBackoffMaximumInterval インタフェース内 WorkerBasebackoffMaximumInterval - maximum interval between poll request retries. Default is
60000 (one minute).WorkerBase.setPollBackoffInitialInterval(long)public boolean isDisableServiceShutdownOnStop()
isDisableServiceShutdownOnStop インタフェース内 WorkerBasepublic void setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)
WorkerBaseAmazonSimpleWorkflow.shutdown() is called. It causes all
outstanding long poll request to disconnect. But also causes all future
request (for example activity completions) to SWF fail.setDisableServiceShutdownOnStop インタフェース内 WorkerBasepublic double getPollBackoffCoefficient()
getPollBackoffCoefficient インタフェース内 WorkerBasepublic void setPollBackoffCoefficient(double backoffCoefficient)
setPollBackoffCoefficient インタフェース内 WorkerBasebackoffCoefficient - coefficient that defines how fast retry interval grows in case
of poll request failures. Default is 2.0.WorkerBase.setPollBackoffInitialInterval(long)public int getPollThreadCount()
getPollThreadCount インタフェース内 WorkerBasepublic void setPollThreadCount(int threadCount)
WorkerBaseActivityWorker 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
setTaskExecutorThreadPoolSize(int).setPollThreadCount インタフェース内 WorkerBasepublic void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)
WorkerBaseSkipTypeRegistration is not specified. Types still can be
registered by calling WorkerBase.registerTypesToPoll().setDisableTypeRegistrationOnStart インタフェース内 WorkerBasepublic boolean isDisableTypeRegistrationOnStart()
isDisableTypeRegistrationOnStart インタフェース内 WorkerBasepublic void registerTypesToPoll()
WorkerBasepublic void start()
start インタフェース内 WorkerLifecyclepublic void shutdown()
shutdown インタフェース内 WorkerLifecyclepublic boolean isRunning()
isRunning インタフェース内 WorkerBasepublic void suspendPolling()
SuspendablesuspendPolling インタフェース内 Suspendablepublic void resumePolling()
SuspendableresumePolling インタフェース内 Suspendablepublic java.lang.String toString()
toString クラス内 java.lang.Object