Package com.uber.cadence.internal.sync
Class SyncWorkflowWorker
- java.lang.Object
-
- com.uber.cadence.internal.sync.SyncWorkflowWorker
-
- All Implemented Interfaces:
Lifecycle
,Shutdownable
,Startable
,Suspendable
,SuspendableWorker
,java.util.function.Consumer<PollForDecisionTaskResponse>
public class SyncWorkflowWorker extends java.lang.Object implements SuspendableWorker, java.util.function.Consumer<PollForDecisionTaskResponse>
Workflow worker that supports POJO workflow implementations.
-
-
Constructor Summary
Constructors Constructor Description SyncWorkflowWorker(IWorkflowService service, java.lang.String domain, java.lang.String taskList, java.util.function.Function<WorkflowInterceptor,WorkflowInterceptor> interceptorFactory, SingleWorkerOptions workflowOptions, SingleWorkerOptions localActivityOptions, SingleWorkerOptions locallyDispatchedActivityOptions, DeciderCache cache, java.lang.String stickyTaskListName, java.time.Duration stickyDecisionScheduleToStartTimeout, java.util.concurrent.ThreadPoolExecutor workflowThreadPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PollForDecisionTaskResponse pollForDecisionTaskResponse)
<R> void
addWorkflowImplementationFactory(WorkflowImplementationOptions options, java.lang.Class<R> clazz, Functions.Func<R> factory)
<R> void
addWorkflowImplementationFactory(java.lang.Class<R> clazz, Functions.Func<R> factory)
void
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
java.util.concurrent.CompletableFuture<java.lang.Boolean>
isHealthy()
boolean
isShutdown()
boolean
isStarted()
boolean
isSuspended()
boolean
isTerminated()
<R> R
queryWorkflowExecution(WorkflowExecutionHistory history, java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object[] args)
<R> R
queryWorkflowExecution(WorkflowExecution execution, java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object[] args)
void
resumePolling()
Allow new poll requests.void
setActivitiesImplementationToDispatchLocally(java.lang.Object... activitiesImplementation)
void
setLocalActivitiesImplementation(java.lang.Object... activitiesImplementation)
void
setWorkflowImplementationTypes(WorkflowImplementationOptions options, java.lang.Class<?>[] workflowImplementationTypes)
void
shutdown()
void
shutdownNow()
void
start()
void
suspendPolling()
Do not make new poll requests.
-
-
-
Constructor Detail
-
SyncWorkflowWorker
public SyncWorkflowWorker(IWorkflowService service, java.lang.String domain, java.lang.String taskList, java.util.function.Function<WorkflowInterceptor,WorkflowInterceptor> interceptorFactory, SingleWorkerOptions workflowOptions, SingleWorkerOptions localActivityOptions, SingleWorkerOptions locallyDispatchedActivityOptions, DeciderCache cache, java.lang.String stickyTaskListName, java.time.Duration stickyDecisionScheduleToStartTimeout, java.util.concurrent.ThreadPoolExecutor workflowThreadPool)
-
-
Method Detail
-
setWorkflowImplementationTypes
public void setWorkflowImplementationTypes(WorkflowImplementationOptions options, java.lang.Class<?>[] workflowImplementationTypes)
-
addWorkflowImplementationFactory
public <R> void addWorkflowImplementationFactory(WorkflowImplementationOptions options, java.lang.Class<R> clazz, Functions.Func<R> factory)
-
addWorkflowImplementationFactory
public <R> void addWorkflowImplementationFactory(java.lang.Class<R> clazz, Functions.Func<R> factory)
-
setLocalActivitiesImplementation
public void setLocalActivitiesImplementation(java.lang.Object... activitiesImplementation)
-
setActivitiesImplementationToDispatchLocally
public void setActivitiesImplementationToDispatchLocally(java.lang.Object... activitiesImplementation)
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceShutdownable
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceShutdownable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceShutdownable
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfaceShutdownable
-
awaitTermination
public void awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
- Specified by:
awaitTermination
in interfaceShutdownable
-
suspendPolling
public void suspendPolling()
Description copied from interface:Suspendable
Do not make new poll requests. Outstanding long polls still can return tasks after this method was called.- Specified by:
suspendPolling
in interfaceSuspendable
-
resumePolling
public void resumePolling()
Description copied from interface:Suspendable
Allow new poll requests.- Specified by:
resumePolling
in interfaceSuspendable
-
isSuspended
public boolean isSuspended()
- Specified by:
isSuspended
in interfaceSuspendable
-
queryWorkflowExecution
public <R> R queryWorkflowExecution(WorkflowExecution execution, java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
queryWorkflowExecution
public <R> R queryWorkflowExecution(WorkflowExecutionHistory history, java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
accept
public void accept(PollForDecisionTaskResponse pollForDecisionTaskResponse)
- Specified by:
accept
in interfacejava.util.function.Consumer<PollForDecisionTaskResponse>
-
isHealthy
public java.util.concurrent.CompletableFuture<java.lang.Boolean> isHealthy()
-
-