com.amazonaws.services.simpleworkflow.flow.WorkflowWorker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk Show documentation
Show all versions of aws-java-sdk Show documentation
The Amazon Web Services SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).
The newest version!
/*
* Copyright 2012-2014 Amazon.com, 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
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.simpleworkflow.flow;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow;
import com.amazonaws.services.simpleworkflow.flow.pojo.POJOWorkflowDefinitionFactoryFactory;
import com.amazonaws.services.simpleworkflow.flow.worker.GenericWorkflowWorker;
public class WorkflowWorker implements WorkerBase {
private final GenericWorkflowWorker genericWorker;
private final POJOWorkflowDefinitionFactoryFactory factoryFactory = new POJOWorkflowDefinitionFactoryFactory();
private final Collection> workflowImplementationTypes = new ArrayList>();
public WorkflowWorker(AmazonSimpleWorkflow service, String domain, String taskListToPoll) {
genericWorker = new GenericWorkflowWorker(service, domain, taskListToPoll);
genericWorker.setWorkflowDefinitionFactoryFactory(factoryFactory);
}
@Override
public AmazonSimpleWorkflow getService() {
return genericWorker.getService();
}
@Override
public String getDomain() {
return genericWorker.getDomain();
}
@Override
public boolean isRegisterDomain() {
return genericWorker.isRegisterDomain();
}
@Override
public void setRegisterDomain(boolean registerDomain) {
genericWorker.setRegisterDomain(registerDomain);
}
@Override
public long getDomainRetentionPeriodInDays() {
return genericWorker.getDomainRetentionPeriodInDays();
}
@Override
public void setDomainRetentionPeriodInDays(long domainRetentionPeriodInDays) {
genericWorker.setDomainRetentionPeriodInDays(domainRetentionPeriodInDays);
}
@Override
public String getTaskListToPoll() {
return genericWorker.getTaskListToPoll();
}
@Override
public double getMaximumPollRatePerSecond() {
return genericWorker.getMaximumPollRatePerSecond();
}
@Override
public void setMaximumPollRatePerSecond(double maximumPollRatePerSecond) {
genericWorker.setMaximumPollRatePerSecond(maximumPollRatePerSecond);
}
@Override
public int getMaximumPollRateIntervalMilliseconds() {
return genericWorker.getMaximumPollRateIntervalMilliseconds();
}
@Override
public void setMaximumPollRateIntervalMilliseconds(int maximumPollRateIntervalMilliseconds) {
genericWorker.setMaximumPollRateIntervalMilliseconds(maximumPollRateIntervalMilliseconds);
}
@Override
public UncaughtExceptionHandler getUncaughtExceptionHandler() {
return genericWorker.getUncaughtExceptionHandler();
}
@Override
public void setUncaughtExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler) {
genericWorker.setUncaughtExceptionHandler(uncaughtExceptionHandler);
}
@Override
public String getIdentity() {
return genericWorker.getIdentity();
}
@Override
public void setIdentity(String identity) {
genericWorker.setIdentity(identity);
}
@Override
public long getPollBackoffInitialInterval() {
return genericWorker.getPollBackoffInitialInterval();
}
@Override
public void setPollBackoffInitialInterval(long backoffInitialInterval) {
genericWorker.setPollBackoffInitialInterval(backoffInitialInterval);
}
@Override
public long getPollBackoffMaximumInterval() {
return genericWorker.getPollBackoffMaximumInterval();
}
@Override
public void setPollBackoffMaximumInterval(long backoffMaximumInterval) {
genericWorker.setPollBackoffMaximumInterval(backoffMaximumInterval);
}
@Override
public boolean isDisableServiceShutdownOnStop() {
return genericWorker.isDisableServiceShutdownOnStop();
}
@Override
public void setDisableServiceShutdownOnStop(boolean disableServiceShutdownOnStop) {
genericWorker.setDisableServiceShutdownOnStop(disableServiceShutdownOnStop);
}
@Override
public double getPollBackoffCoefficient() {
return genericWorker.getPollBackoffCoefficient();
}
@Override
public void setPollBackoffCoefficient(double backoffCoefficient) {
genericWorker.setPollBackoffCoefficient(backoffCoefficient);
}
@Override
public int getPollThreadCount() {
return genericWorker.getPollThreadCount();
}
@Override
public void setPollThreadCount(int threadCount) {
genericWorker.setPollThreadCount(threadCount);
}
@Override
public void registerTypesToPoll() {
genericWorker.registerTypesToPoll();
}
@Override
public void start() {
genericWorker.start();
}
@Override
public void shutdown() {
genericWorker.shutdown();
}
@Override
public void shutdownNow() {
genericWorker.shutdownNow();
}
@Override
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
return genericWorker.awaitTermination(timeout, unit);
}
@Override
public boolean isRunning() {
return genericWorker.isRunning();
}
@Override
public void suspendPolling() {
genericWorker.suspendPolling();
}
@Override
public void resumePolling() {
genericWorker.resumePolling();
}
public void setWorkflowImplementationTypes(Collection> workflowImplementationTypes)
throws InstantiationException, IllegalAccessException {
for (Class> workflowImplementationType : workflowImplementationTypes) {
addWorkflowImplementationType(workflowImplementationType);
}
}
public Collection> getWorkflowImplementationTypes() {
return workflowImplementationTypes;
}
public void addWorkflowImplementationType(Class> workflowImplementationType) throws InstantiationException, IllegalAccessException {
factoryFactory.addWorkflowImplementationType(workflowImplementationType);
}
public void addWorkflowImplementationType(Class> workflowImplementationType, DataConverter converter) throws InstantiationException, IllegalAccessException {
factoryFactory.addWorkflowImplementationType(workflowImplementationType, converter);
}
@Override
public String toString() {
return this.getClass().getSimpleName() + "[genericWorker=" + genericWorker + ", wokflowImplementationTypes="
+ workflowImplementationTypes + "]";
}
@Override
public boolean shutdownAndAwaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
return genericWorker.shutdownAndAwaitTermination(timeout, unit);
}
public DataConverter getDataConverter() {
return factoryFactory.getDataConverter();
}
public void setDefaultConverter(DataConverter converter) {
factoryFactory.setDataConverter(converter);
}
@Override
public void setDisableTypeRegistrationOnStart(boolean disableTypeRegistrationOnStart) {
genericWorker.setDisableTypeRegistrationOnStart(disableTypeRegistrationOnStart);
}
@Override
public boolean isDisableTypeRegistrationOnStart() {
return genericWorker.isDisableTypeRegistrationOnStart();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy