Package io.temporal.activity
Class Activity
- java.lang.Object
-
- io.temporal.activity.Activity
-
public final class Activity extends java.lang.Object
An Activity is the implementation of a particular task in the business logic.- See Also:
Worker
,Workflow
,WorkflowClient
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ActivityExecutionContext
getExecutionContext()
Can be used to get information about an Activity Execution and to invoke Heartbeats.static java.lang.RuntimeException
wrap(java.lang.Throwable e)
Use this to rethrow a checked exception from an Activity Execution instead of adding the exception to a method signature.
-
-
-
Method Detail
-
getExecutionContext
public static ActivityExecutionContext getExecutionContext()
Can be used to get information about an Activity Execution and to invoke Heartbeats. This static method relies on a thread-local variable and works only in the original Activity Execution thread.
-
wrap
public static java.lang.RuntimeException wrap(java.lang.Throwable e)
Use this to rethrow a checked exception from an Activity Execution instead of adding the exception to a method signature.- Returns:
- Never returns; always throws. Throws original exception if e is
RuntimeException
orError
.
-
-