Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright 2012, Inc. or its affiliates. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License"). You may not
   * use this file except in compliance with the License. A copy of the License is
   * located at
  * or in the "license" file accompanying this file. This file is distributed on
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
 public interface WorkerBase extends SuspendableWorker {
     String getDomain();
     boolean isRegisterDomain();

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

     void setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays);

Task list name that given worker polls for tasks.
     double getMaximumPollRatePerSecond();

Maximum number of poll request to the task list per second allowed. Default is 0 which means unlimited.

     void setMaximumPollRatePerSecond(double maximumPollRatePerSecond);
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.

     void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds);
Handler notified about poll request and other unexpected failures. The default implementation logs the failures using ERROR level.
     void setUncaughtExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler);
     String getIdentity();

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".

identity maximum size is 256 characters.
     void setIdentity(String identity);
     long getPollBackoffInitialInterval();

Failed poll requests are retried after an interval defined by an exponential backoff algorithm. See BackoffThrottler for more info.

backoffInitialInterval the interval between failure and the first retry. Default is 100.
    void setPollBackoffInitialInterval(long backoffInitialInterval);
    long getPollBackoffMaximumInterval();


backoffMaximumInterval maximum interval between poll request retries. Default is 60000 (one minute).
See also:
    void setPollBackoffMaximumInterval(long backoffMaximumInterval);
    double getPollBackoffCoefficient();


backoffCoefficient coefficient that defines how fast retry interval grows in case of poll request failures. Default is 2.0.
See also:
    void setPollBackoffCoefficient(double backoffCoefficient);
    boolean isDisableServiceShutdownOnStop();

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

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

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

    void registerTypesToPoll();
    boolean isRunning();

When set to true disables types registration on start even if is not specified. Types still can be registered by calling registerTypesToPoll().
    void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart);
New to GrepCode? Check out our FAQ X