Package io.temporal.common.interceptors
Interface WorkflowInboundCallsInterceptor
-
- All Known Implementing Classes:
BaseRootWorkflowInboundCallsInterceptor
,WorkflowInboundCallsInterceptorBase
public interface WorkflowInboundCallsInterceptor
Intercepts inbound calls to the workflow execution on the worker side.An instance should be created in
WorkerInterceptor.interceptWorkflow(WorkflowInboundCallsInterceptor)
.The calls to this interceptor are executed under workflow context, all the rules and restrictions on the workflow code apply. See
io.temporal.workflow
.Prefer extending
WorkflowInboundCallsInterceptorBase
and overriding only the methods you need instead of implementing this interface directly.WorkflowInboundCallsInterceptorBase
provides correct default implementations to all the methods of this interface.The implementation must forward all the calls to
next
, but it may change the input parameters.- See Also:
for a definition of "next"
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
WorkflowInboundCallsInterceptor.QueryInput
static class
WorkflowInboundCallsInterceptor.QueryOutput
static class
WorkflowInboundCallsInterceptor.SignalInput
static class
WorkflowInboundCallsInterceptor.WorkflowInput
static class
WorkflowInboundCallsInterceptor.WorkflowOutput
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkflowInboundCallsInterceptor.WorkflowOutput
execute(WorkflowInboundCallsInterceptor.WorkflowInput input)
Called when workflow main method is called.WorkflowInboundCallsInterceptor.QueryOutput
handleQuery(WorkflowInboundCallsInterceptor.QueryInput input)
Called when a workflow is queried.void
handleSignal(WorkflowInboundCallsInterceptor.SignalInput input)
Called when signal is delivered to a workflow execution.void
init(WorkflowOutboundCallsInterceptor outboundCalls)
Called when workflow class is instantiated.java.lang.Object
newCallbackThread(java.lang.Runnable runnable, java.lang.String name)
Intercepts creation of a workflow callback threadjava.lang.Object
newWorkflowMethodThread(java.lang.Runnable runnable, java.lang.String name)
Intercepts creation of the workflow main method thread
-
-
-
Method Detail
-
init
void init(WorkflowOutboundCallsInterceptor outboundCalls)
Called when workflow class is instantiated. May create aWorkflowOutboundCallsInterceptor
instance. The instance must forward all the calls tooutboundCalls
, but it may change the input parameters.The instance should be passed into the {next.init(newWorkflowOutboundCallsInterceptor)}.
- Parameters:
outboundCalls
- an existing interceptor instance to be proxied by the interceptor created inside this method- See Also:
for the definition of "next"
-
execute
WorkflowInboundCallsInterceptor.WorkflowOutput execute(WorkflowInboundCallsInterceptor.WorkflowInput input)
Called when workflow main method is called.- Returns:
- result of the workflow execution.
-
handleSignal
void handleSignal(WorkflowInboundCallsInterceptor.SignalInput input)
Called when signal is delivered to a workflow execution.
-
handleQuery
WorkflowInboundCallsInterceptor.QueryOutput handleQuery(WorkflowInboundCallsInterceptor.QueryInput input)
Called when a workflow is queried.
-
newWorkflowMethodThread
@Nonnull java.lang.Object newWorkflowMethodThread(java.lang.Runnable runnable, @Nullable java.lang.String name)
Intercepts creation of the workflow main method thread- Parameters:
runnable
- thread function to runname
- name of the thread, optional- Returns:
- created workflow thread. Should be treated as a pass-through object that shouldn't be manipulated in any way by the interceptor code.
-
newCallbackThread
@Nonnull java.lang.Object newCallbackThread(java.lang.Runnable runnable, @Nullable java.lang.String name)
Intercepts creation of a workflow callback thread- Parameters:
runnable
- thread function to runname
- name of the thread, optional- Returns:
- created workflow thread. Should be treated as a pass-through object that shouldn't be manipulated in any way by the interceptor code.
-
-