Interface NexusServiceStub
- All Known Implementing Classes:
NexusServiceStubImpl
public interface NexusServiceStub
NexusServiceStub is used to start operations on a Nexus service without referencing an interface
it implements. This is useful to call operations when their type is not known at compile time or
to execute operations implemented in other languages. Created through
Workflow.newNexusServiceStub(Class).-
Method Summary
Modifier and TypeMethodDescription<R> RExecutes an operation by its type name and arguments.<R> RExecutes an operation by its type name and arguments.<R> Promise<R> executeAsync(String operationName, Class<R> resultClass, Object arg) Executes an operation asynchronously by its type name and arguments.<R> Promise<R> executeAsync(String operationName, Class<R> resultClass, Type resultType, Object arg) Executes an operation asynchronously by its type name and arguments.<R> NexusOperationHandle<R> Request to start an operation by its type name and arguments<R> NexusOperationHandle<R> Request to start an operation by its type name and arguments
-
Method Details
-
execute
Executes an operation by its type name and arguments. Blocks until the operation completion.- Type Parameters:
R- return type.- Parameters:
operationName- name of the operation type to execute.resultClass- the expected return type of the operation.arg- argument of the operation.- Returns:
- an operation result.
-
execute
Executes an operation by its type name and arguments. Blocks until the operation completion.- Type Parameters:
R- return type.- Parameters:
operationName- name of the operation type to execute.resultClass- the expected return type of the operation.resultType- the expected return type of the nexus operation. Differs from resultClass for generic types.arg- argument of the operation.- Returns:
- an operation result.
-
executeAsync
Executes an operation asynchronously by its type name and arguments.- Type Parameters:
R- return type.- Parameters:
operationName- name of an operation type to execute.resultClass- the expected return type of the operation. Use Void.class for operations that return void type.arg- argument of the operation.- Returns:
- Promise to the operation result.
-
executeAsync
<R> Promise<R> executeAsync(String operationName, Class<R> resultClass, Type resultType, Object arg) Executes an operation asynchronously by its type name and arguments.- Type Parameters:
R- return type.- Parameters:
operationName- name of an operation type to execute.resultClass- the expected return type of the operation. Use Void.class for operations that return void type.resultType- the expected return type of the nexus operation. Differs from resultClass for generic types.arg- argument of the operation.- Returns:
- Promise to the operation result.
-
start
Request to start an operation by its type name and arguments- Type Parameters:
R- return type.- Parameters:
operationName- name of an operation type to execute.resultClass- the expected return type of the operation. Use Void.class for operations that return void type.arg- argument of the operation.- Returns:
- A handle that can be used to wait for the operation to start or wait for it to finish
-
start
<R> NexusOperationHandle<R> start(String operationName, Class<R> resultClass, Type resultType, Object arg) Request to start an operation by its type name and arguments- Type Parameters:
R- return type.- Parameters:
operationName- name of an operation type to execute.resultClass- the expected return type of the operation. Use Void.class for operations that return void type.resultType- the expected return type of the nexus operation. Differs from resultClass for generic types.arg- argument of the operation.- Returns:
- A handle that can be used to wait for the operation to start or wait for it to finish
-
getOptions
NexusServiceOptions getOptions()- Returns:
- Options used to create this stub.
-