public final class WorkflowInternal
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_VERSION |
Modifier and Type | Method and Description |
---|---|
static boolean |
await(java.time.Duration timeout,
java.lang.String reason,
java.util.function.Supplier<java.lang.Boolean> unblockCondition) |
static void |
await(java.lang.String reason,
java.util.function.Supplier<java.lang.Boolean> unblockCondition) |
static Promise<java.lang.Void> |
cancelWorkflow(WorkflowExecution execution) |
static void |
continueAsNew(java.util.Optional<java.lang.String> workflowType,
java.util.Optional<ContinueAsNewOptions> options,
java.lang.Object[] args) |
static void |
continueAsNew(java.util.Optional<java.lang.String> workflowType,
java.util.Optional<ContinueAsNewOptions> options,
java.lang.Object[] args,
WorkflowInterceptor decisionContext) |
static com.uber.cadence.internal.sync.CancellationScopeImpl |
currentCancellationScope() |
static long |
currentTimeMillis()
Should be used to get current time instead of
System.currentTimeMillis() |
static <R> R |
executeActivity(java.lang.String name,
ActivityOptions options,
java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType,
java.lang.Object... args)
Execute activity by name.
|
static org.slf4j.Logger |
getLogger(java.lang.Class<?> clazz) |
static org.slf4j.Logger |
getLogger(java.lang.String name) |
static com.uber.m3.tally.Scope |
getMetricsScope() |
static int |
getVersion(java.lang.String changeID,
int minSupported,
int maxSupported) |
static Promise<WorkflowExecution> |
getWorkflowExecution(java.lang.Object workflowStub) |
static WorkflowInfo |
getWorkflowInfo() |
static boolean |
isReplaying() |
static <R> R |
mutableSideEffect(java.lang.String id,
java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType,
java.util.function.BiPredicate<R,R> updated,
Functions.Func<R> func) |
static <T> T |
newActivityStub(java.lang.Class<T> activityInterface,
ActivityOptions options)
Creates client stub to activities that implement given interface.
|
static CancellationScope |
newCancellationScope(boolean detached,
java.lang.Runnable runnable) |
static <T> T |
newChildWorkflowStub(java.lang.Class<T> workflowInterface,
ChildWorkflowOptions options) |
static <E> CompletablePromise<E> |
newCompletablePromise() |
static <T> T |
newContinueAsNewStub(java.lang.Class<T> workflowInterface,
ContinueAsNewOptions options)
Creates client stub that can be used to continue this workflow as new.
|
static <T> T |
newExternalWorkflowStub(java.lang.Class<T> workflowInterface,
WorkflowExecution execution) |
static <E> Promise<E> |
newFailedPromise(java.lang.Exception failure) |
static <E> Promise<E> |
newPromise(E value) |
static <E> WorkflowQueue<E> |
newQueue(int capacity) |
static java.util.Random |
newRandom() |
static com.uber.cadence.internal.sync.WorkflowThread |
newThread(boolean ignoreParentCancellation,
java.lang.Runnable runnable) |
static com.uber.cadence.internal.sync.WorkflowThread |
newThread(boolean ignoreParentCancellation,
java.lang.String name,
java.lang.Runnable runnable) |
static Promise<java.lang.Void> |
newTimer(java.time.Duration duration) |
static ActivityStub |
newUntypedActivityStub(ActivityOptions options) |
static ChildWorkflowStub |
newUntypedChildWorkflowStub(java.lang.String workflowType,
ChildWorkflowOptions options) |
static ExternalWorkflowStub |
newUntypedExternalWorkflowStub(WorkflowExecution execution) |
static <U> Promise<java.util.List<U>> |
promiseAllOf(java.util.Collection<Promise<U>> promises) |
static Promise<java.lang.Void> |
promiseAllOf(Promise<?>... promises) |
static Promise<java.lang.Object> |
promiseAnyOf(java.lang.Iterable<Promise<?>> promises) |
static Promise<java.lang.Object> |
promiseAnyOf(Promise<?>... promises) |
static java.util.UUID |
randomUUID() |
static void |
registerQuery(java.lang.Object queryImplementation)
Register query or queries implementation object.
|
static <R> R |
retry(RetryOptions options,
Functions.Func<R> fn) |
static <R> R |
sideEffect(java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType,
Functions.Func<R> func) |
static void |
sleep(java.time.Duration duration) |
static java.lang.Exception |
unwrap(java.lang.Exception e) |
static java.lang.RuntimeException |
wrap(java.lang.Throwable e) |
public static final int DEFAULT_VERSION
public static com.uber.cadence.internal.sync.WorkflowThread newThread(boolean ignoreParentCancellation, java.lang.Runnable runnable)
public static com.uber.cadence.internal.sync.WorkflowThread newThread(boolean ignoreParentCancellation, java.lang.String name, java.lang.Runnable runnable)
public static Promise<java.lang.Void> newTimer(java.time.Duration duration)
public static <E> WorkflowQueue<E> newQueue(int capacity)
public static <E> CompletablePromise<E> newCompletablePromise()
public static <E> Promise<E> newPromise(E value)
public static <E> Promise<E> newFailedPromise(java.lang.Exception failure)
public static void registerQuery(java.lang.Object queryImplementation)
QueryMethod
are registered.public static long currentTimeMillis()
System.currentTimeMillis()
public static <T> T newActivityStub(java.lang.Class<T> activityInterface, ActivityOptions options)
activityInterface
- interface type implemented by activitiespublic static ActivityStub newUntypedActivityStub(ActivityOptions options)
public static <T> T newChildWorkflowStub(java.lang.Class<T> workflowInterface, ChildWorkflowOptions options)
public static <T> T newExternalWorkflowStub(java.lang.Class<T> workflowInterface, WorkflowExecution execution)
public static Promise<WorkflowExecution> getWorkflowExecution(java.lang.Object workflowStub)
public static ChildWorkflowStub newUntypedChildWorkflowStub(java.lang.String workflowType, ChildWorkflowOptions options)
public static ExternalWorkflowStub newUntypedExternalWorkflowStub(WorkflowExecution execution)
public static <T> T newContinueAsNewStub(java.lang.Class<T> workflowInterface, ContinueAsNewOptions options)
workflowInterface
- interface type implemented by the next generation of workflowpublic static <R> R executeActivity(java.lang.String name, ActivityOptions options, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
R
- activity return typename
- name of the activityresultClass
- activity return typeargs
- list of activity argumentspublic static void await(java.lang.String reason, java.util.function.Supplier<java.lang.Boolean> unblockCondition) throws com.uber.cadence.internal.sync.DestroyWorkflowThreadError
com.uber.cadence.internal.sync.DestroyWorkflowThreadError
public static boolean await(java.time.Duration timeout, java.lang.String reason, java.util.function.Supplier<java.lang.Boolean> unblockCondition) throws com.uber.cadence.internal.sync.DestroyWorkflowThreadError
com.uber.cadence.internal.sync.DestroyWorkflowThreadError
public static <R> R sideEffect(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, Functions.Func<R> func)
public static <R> R mutableSideEffect(java.lang.String id, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.util.function.BiPredicate<R,R> updated, Functions.Func<R> func)
public static int getVersion(java.lang.String changeID, int minSupported, int maxSupported)
public static <U> Promise<java.util.List<U>> promiseAllOf(java.util.Collection<Promise<U>> promises)
public static Promise<java.lang.Object> promiseAnyOf(java.lang.Iterable<Promise<?>> promises)
public static CancellationScope newCancellationScope(boolean detached, java.lang.Runnable runnable)
public static com.uber.cadence.internal.sync.CancellationScopeImpl currentCancellationScope()
public static java.lang.RuntimeException wrap(java.lang.Throwable e)
public static java.lang.Exception unwrap(java.lang.Exception e)
public static boolean isReplaying()
public static WorkflowInfo getWorkflowInfo()
public static <R> R retry(RetryOptions options, Functions.Func<R> fn)
public static void continueAsNew(java.util.Optional<java.lang.String> workflowType, java.util.Optional<ContinueAsNewOptions> options, java.lang.Object[] args)
public static void continueAsNew(java.util.Optional<java.lang.String> workflowType, java.util.Optional<ContinueAsNewOptions> options, java.lang.Object[] args, WorkflowInterceptor decisionContext)
public static Promise<java.lang.Void> cancelWorkflow(WorkflowExecution execution)
public static void sleep(java.time.Duration duration)
public static com.uber.m3.tally.Scope getMetricsScope()
public static java.util.UUID randomUUID()
public static java.util.Random newRandom()
public static org.slf4j.Logger getLogger(java.lang.Class<?> clazz)
public static org.slf4j.Logger getLogger(java.lang.String name)