Package com.amazonaws.services.simpleworkflow.flow

Examples of com.amazonaws.services.simpleworkflow.flow.ActivityWorker


    public static void main(String[] args) throws Exception {
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        CronWithRetryExampleActivities periodicActivitiesImpl = new CronExampleActivitiesImpl();
        worker.addActivitiesImplementation(periodicActivitiesImpl);

        worker.start();

        System.out.println("Activity Worker Started for Task List: " + worker.getTaskListToPoll());

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    worker.shutdownAndAwaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Worker Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here


    public static void main(String[] args) throws Exception {
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        HelloWorldActivities helloWorldActivitiesImpl = new HelloWorldActivitiesImpl();
        worker.addActivitiesImplementation(helloWorldActivitiesImpl);

        worker.start();

        System.out.println("Activity Worker Started for Task List: " + worker.getTaskListToPoll());

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    worker.shutdownAndAwaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Worker Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

    public static void main(String[] args) throws Exception {
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        CronExampleActivities periodicActivitiesImpl = new CronExampleActivitiesImpl();
        worker.addActivitiesImplementation(periodicActivitiesImpl);

        worker.start();

        System.out.println("Activity Worker Started for Task List: " + worker.getTaskListToPoll());

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    worker.shutdownAndAwaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Worker Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

      // Create activity implementations
      BookingActivities bookingActivitiesImpl = new BookingActivitiesImpl();
     
      // Start worker to poll the common task list
      String taskList = configHelper.getValueFromConfig(BookingConfigKeys.ACTIVITY_WORKER_TASKLIST);
        worker = new ActivityWorker(swfService, domain, taskList);
        worker.setDomainRetentionPeriodInDays(domainRetentionPeriodInDays);
        worker.setRegisterDomain(true);
      worker.addActivitiesImplementation(bookingActivitiesImpl);
      worker.start();
        System.out.println("Worker Started for Activity Task List: " + taskList);     
View Full Code Here

    public static void main(String[] args) throws Exception {
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        PeriodicWorkflowActivities periodicActivitiesImpl = new PeriodicWorkflowActivitiesImpl();
        worker.addActivitiesImplementation(periodicActivitiesImpl);

        worker.start();

        System.out.println("Activity Worker Started for Task List: " + worker.getTaskListToPoll());

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    worker.shutdownAndAwaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Worker Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

        String domain = configHelper.getDomain();

        String localFolder = configHelper.getValueFromConfig(FileProcessingConfigKeys.ACTIVITY_WORKER_LOCALFOLDER);
       
        // Start worker to poll the common task list
        final ActivityWorker workerForCommonTaskList = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);
        SimpleStoreActivitiesS3Impl storeActivityImpl = new SimpleStoreActivitiesS3Impl(s3Client, localFolder, getHostName());
        workerForCommonTaskList.addActivitiesImplementation(storeActivityImpl);
        workerForCommonTaskList.start();
        System.out.println("Host Service Started for Task List: " + ACTIVITIES_TASK_LIST);       
       
        // Start worker to poll the host specific task list
        final ActivityWorker workerForHostSpecificTaskList =  new ActivityWorker(swfService, domain, getHostName());
        workerForHostSpecificTaskList.addActivitiesImplementation(storeActivityImpl);
        FileProcessingActivitiesZipImpl processorActivityImpl = new FileProcessingActivitiesZipImpl(localFolder);
        workerForHostSpecificTaskList.addActivitiesImplementation(processorActivityImpl);
        workerForHostSpecificTaskList.start();
        System.out.println("Worker Started for Activity Task List: " + getHostName());     

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    workerForCommonTaskList.shutdown();
                    workerForHostSpecificTaskList.shutdown();
                    workerForCommonTaskList.awaitTermination(1, TimeUnit.MINUTES);
                    workerForHostSpecificTaskList.awaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Workers Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        AmazonS3 s3Client = configHelper.createS3Client();
        String domain = configHelper.getDomain();

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        AverageCalculatorActivitiesImpl avgCalcActivitiesImpl = new AverageCalculatorActivitiesImpl(s3Client);
        worker.addActivitiesImplementation(avgCalcActivitiesImpl);

        worker.start();

        System.out.println("Activity Worker Started for Task List: " + worker.getTaskListToPoll());

        Runtime.getRuntime().addShutdownHook(new Thread() {

            public void run() {
                try {
                    worker.shutdownAndAwaitTermination(1, TimeUnit.MINUTES);
                    System.out.println("Activity Worker Exited.");
                }
                catch (InterruptedException e) {
                    e.printStackTrace();
                }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleworkflow.flow.ActivityWorker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.