Package com.uber.cadence.internal.sync
Class ActivityStubImpl
- java.lang.Object
-
- com.uber.cadence.internal.sync.ActivityStubImpl
-
- All Implemented Interfaces:
ActivityStub
public class ActivityStubImpl extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityOptions
options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
execute(java.lang.String activityName, java.lang.Class<T> resultClass, java.lang.Object... args)
Executes an activity by its type name and arguments.<T> T
execute(java.lang.String activityName, java.lang.Class<T> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
Executes an activity by its type name and arguments.<R> Promise<R>
executeAsync(java.lang.String activityName, java.lang.Class<R> resultClass, java.lang.Object... args)
Executes an activity asynchronously by its type name and arguments.<R> Promise<R>
executeAsync(java.lang.String activityName, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
Executes an activity asynchronously by its type name and arguments.
-
-
-
Field Detail
-
options
protected final ActivityOptions options
-
-
Method Detail
-
executeAsync
public <R> Promise<R> executeAsync(java.lang.String activityName, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
Description copied from interface:ActivityStub
Executes an activity asynchronously by its type name and arguments.- Specified by:
executeAsync
in interfaceActivityStub
- Type Parameters:
R
- return type.- Parameters:
activityName
- name of an activity type to execute.resultClass
- the expected return class of the activity. Use Void.class for activities that return void type.resultType
- the expected return type of the activity. Differs from resultClass for generic types.args
- arguments of the activity.- Returns:
- Promise to the activity result.
-
execute
public <T> T execute(java.lang.String activityName, java.lang.Class<T> resultClass, java.lang.Object... args)
Description copied from interface:ActivityStub
Executes an activity by its type name and arguments. Blocks until the activity completion.- Specified by:
execute
in interfaceActivityStub
- Type Parameters:
T
- return type.- Parameters:
activityName
- name of an activity type to execute.resultClass
- the expected return type of the activity. Use Void.class for activities that return void type.args
- arguments of the activity.- Returns:
- an activity result.
-
execute
public <T> T execute(java.lang.String activityName, java.lang.Class<T> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
Description copied from interface:ActivityStub
Executes an activity by its type name and arguments. Blocks until the activity completion.- Specified by:
execute
in interfaceActivityStub
- Type Parameters:
T
- return type.- Parameters:
activityName
- name of an activity type to execute.resultClass
- the expected return class of the activity. Use Void.class for activities that return void type.resultType
- the expected return type of the activity. Differs from resultClass for generic types.args
- arguments of the activity.- Returns:
- an activity result.
-
executeAsync
public <R> Promise<R> executeAsync(java.lang.String activityName, java.lang.Class<R> resultClass, java.lang.Object... args)
Description copied from interface:ActivityStub
Executes an activity asynchronously by its type name and arguments.- Specified by:
executeAsync
in interfaceActivityStub
- Type Parameters:
R
- return type.- Parameters:
activityName
- name of an activity type to execute.resultClass
- the expected return type of the activity. Use Void.class for activities that return void type.args
- arguments of the activity.- Returns:
- Promise to the activity result.
-
-