public interface WorkerBase extends SuspendableWorker
Modifier and Type | Method and Description |
---|---|
String |
getDomain() |
long |
getDomainRetentionPeriodInDays() |
String |
getIdentity() |
int |
getMaximumPollRateIntervalMilliseconds() |
double |
getMaximumPollRatePerSecond() |
double |
getPollBackoffCoefficient() |
long |
getPollBackoffInitialInterval() |
long |
getPollBackoffMaximumInterval() |
int |
getPollThreadCount() |
AmazonSimpleWorkflow |
getService() |
String |
getTaskListToPoll()
Task list name that given worker polls for tasks.
|
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 |
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 domainRetentionPeriodInDays)
Value of DomainRetentionPeriodInDays parameter passed to
AmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest) call. |
void |
setIdentity(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 |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Handler notified about poll request and other unexpected failures.
|
resumePolling, suspendPolling
awaitTermination, shutdown, shutdownAndAwaitTermination, shutdownNow, start
AmazonSimpleWorkflow getService()
String getDomain()
boolean isRegisterDomain()
void setRegisterDomain(boolean registerDomain)
false
.
When enabled #setDomainRetentionPeriodInDays(Long)
property is
required.long getDomainRetentionPeriodInDays()
void setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays)
AmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest)
call. Required when
isRegisterDomain()
is true
.String getTaskListToPoll()
double getMaximumPollRatePerSecond()
void setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
int getMaximumPollRateIntervalMilliseconds()
void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
setMaximumPollRatePerSecond(double)
Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
String getIdentity()
void setIdentity(String identity)
identity
- maximum size is 256 characters.long getPollBackoffInitialInterval()
void setPollBackoffInitialInterval(long backoffInitialInterval)
backoffInitialInterval
- the interval between failure and the first retry. Default is
100.long getPollBackoffMaximumInterval()
void setPollBackoffMaximumInterval(long backoffMaximumInterval)
backoffMaximumInterval
- maximum interval between poll request retries. Default is
60000 (one minute).setPollBackoffInitialInterval(long)
double getPollBackoffCoefficient()
void setPollBackoffCoefficient(double backoffCoefficient)
backoffCoefficient
- coefficient that defines how fast retry interval grows in case
of poll request failures. Default is 2.0.setPollBackoffInitialInterval(long)
boolean isDisableServiceShutdownOnStop()
void setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)
AmazonSimpleWorkflow.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.int getPollThreadCount()
void setPollThreadCount(int threadCount)
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)
.void registerTypesToPoll()
boolean isRunning()
void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)
SkipTypeRegistration
is not specified. Types still can be
registered by calling registerTypesToPoll()
.boolean isDisableTypeRegistrationOnStart()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.