Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow
Interface WorkerBase

All Superinterfaces:
Suspendable, SuspendableWorker, WorkerLifecycle
All Known Implementing Classes:
ActivityWorker, GenericActivityWorker, GenericWorker, GenericWorkflowWorker, SpringActivityWorker, SpringWorkflowWorker, WorkflowWorker

public interface WorkerBase
extends SuspendableWorker


Method Summary
 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.
 
Methods inherited from interface com.amazonaws.services.simpleworkflow.flow.Suspendable
resumePolling, suspendPolling
 
Methods inherited from interface com.amazonaws.services.simpleworkflow.flow.WorkerLifecycle
awaitTermination, shutdown, shutdownAndAwaitTermination, shutdownNow, start
 

Method Detail

getService

AmazonSimpleWorkflow getService()

getDomain

String getDomain()

isRegisterDomain

boolean isRegisterDomain()

setRegisterDomain

void setRegisterDomain(boolean registerDomain)
Should domain be registered on startup. Default is false. When enabled #setDomainRetentionPeriodInDays(Long) property is required.


getDomainRetentionPeriodInDays

long getDomainRetentionPeriodInDays()

setDomainRetentionPeriodInDays

void setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays)
Value of DomainRetentionPeriodInDays parameter passed to AmazonSimpleWorkflow.registerDomain(com.amazonaws.services.simpleworkflow.model.RegisterDomainRequest) call. Required when isRegisterDomain() is true.


getTaskListToPoll

String getTaskListToPoll()
Task list name that given worker polls for tasks.


getMaximumPollRatePerSecond

double getMaximumPollRatePerSecond()

setMaximumPollRatePerSecond

void setMaximumPollRatePerSecond(double maximumPollRatePerSecond)
Maximum number of poll request to the task list per second allowed. Default is 0 which means unlimited.

See Also:
setMaximumPollRateIntervalMilliseconds(int)

getMaximumPollRateIntervalMilliseconds

int getMaximumPollRateIntervalMilliseconds()

setMaximumPollRateIntervalMilliseconds

void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds)
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.

See Also:
setMaximumPollRatePerSecond(double)

getUncaughtExceptionHandler

Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()

setUncaughtExceptionHandler

void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Handler notified about poll request and other unexpected failures. The default implementation logs the failures using ERROR level.


getIdentity

String getIdentity()

setIdentity

void setIdentity(String identity)
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".

Parameters:
identity - maximum size is 256 characters.

getPollBackoffInitialInterval

long getPollBackoffInitialInterval()

setPollBackoffInitialInterval

void setPollBackoffInitialInterval(long backoffInitialInterval)
Failed poll requests are retried after an interval defined by an exponential backoff algorithm. See BackoffThrottler for more info.

Parameters:
backoffInitialInterval - the interval between failure and the first retry. Default is 100.

getPollBackoffMaximumInterval

long getPollBackoffMaximumInterval()

setPollBackoffMaximumInterval

void setPollBackoffMaximumInterval(long backoffMaximumInterval)
Parameters:
backoffMaximumInterval - maximum interval between poll request retries. Default is 60000 (one minute).
See Also:
setPollBackoffInitialInterval(long)

getPollBackoffCoefficient

double getPollBackoffCoefficient()

setPollBackoffCoefficient

void setPollBackoffCoefficient(double backoffCoefficient)
Parameters:
backoffCoefficient - coefficient that defines how fast retry interval grows in case of poll request failures. Default is 2.0.
See Also:
setPollBackoffInitialInterval(long)

isDisableServiceShutdownOnStop

boolean isDisableServiceShutdownOnStop()

setDisableServiceShutdownOnStop

void setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop)
When set to false (which is default) at the beginning of the worker shutdown 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.


getPollThreadCount

int getPollThreadCount()

setPollThreadCount

void setPollThreadCount(int threadCount)
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).


registerTypesToPoll

void registerTypesToPoll()
Try to register every type (activity or workflow depending on worker) that are configured with the worker.

See Also:
setDisableTypeRegistrationOnStart(boolean)

isRunning

boolean isRunning()

setDisableTypeRegistrationOnStart

void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart)
When set to true disables types registration on start even if SkipTypeRegistration is not specified. Types still can be registered by calling registerTypesToPoll().


isDisableTypeRegistrationOnStart

boolean isDisableTypeRegistrationOnStart()


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.