Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleworkflow.flow.worker
Class ActivityTaskPoller

java.lang.Object
  extended by com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller
      extended by com.amazonaws.services.simpleworkflow.flow.worker.ActivityTaskPoller
All Implemented Interfaces:
TaskPoller

public class ActivityTaskPoller
extends SynchronousActivityTaskPoller


Constructor Summary
ActivityTaskPoller(AmazonSimpleWorkflow service, String domain, String pollTaskList, ActivityImplementationFactory activityImplementationFactory, ThreadPoolExecutor taskExecutorService)
           
 
Method Summary
 boolean awaitTermination(long timeout, TimeUnit unit)
           
 ExecutorService getTaskExecutorService()
           
 boolean pollAndProcessSingleTask()
          Poll for a activity task and execute correspondent implementation using provided executor service.
 void setTaskExecutorService(ThreadPoolExecutor taskExecutorService)
           
 void shutdown()
           
 void shutdownNow()
           
 
Methods inherited from class com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller
getActivityImplementationFactory, getDomain, getIdentity, getPollTaskList, getReportCompletionRetryParameters, getReportFailureRetryParameters, getService, getTaskListToPoll, poll, setActivityImplementationFactory, setDomain, setIdentity, setReportCompletionRetryParameters, setReportFailureRetryParameters, setService, setTaskListToPoll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityTaskPoller

public ActivityTaskPoller(AmazonSimpleWorkflow service,
                          String domain,
                          String pollTaskList,
                          ActivityImplementationFactory activityImplementationFactory,
                          ThreadPoolExecutor taskExecutorService)
Method Detail

getTaskExecutorService

public ExecutorService getTaskExecutorService()

setTaskExecutorService

public void setTaskExecutorService(ThreadPoolExecutor taskExecutorService)

pollAndProcessSingleTask

public boolean pollAndProcessSingleTask()
                                 throws Exception
Poll for a activity task and execute correspondent implementation using provided executor service.

Specified by:
pollAndProcessSingleTask in interface TaskPoller
Overrides:
pollAndProcessSingleTask in class SynchronousActivityTaskPoller
Returns:
true if task was polled and decided upon, false if poll timed out
Throws:
Exception

shutdown

public void shutdown()
Specified by:
shutdown in interface TaskPoller
Overrides:
shutdown in class SynchronousActivityTaskPoller

shutdownNow

public void shutdownNow()
Specified by:
shutdownNow in interface TaskPoller
Overrides:
shutdownNow in class SynchronousActivityTaskPoller

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
                         throws InterruptedException
Specified by:
awaitTermination in interface TaskPoller
Overrides:
awaitTermination in class SynchronousActivityTaskPoller
Throws:
InterruptedException


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