public interface ActivityExecutionContext
Activity.getExecutionContext()
from an activity implementation to access.Modifier and Type | Method and Description |
---|---|
void |
doNotCompleteOnReturn()
If this method is called during an activity execution then activity is not going to complete
when its method returns.
|
<V> java.util.Optional<V> |
getHeartbeatDetails(java.lang.Class<V> detailsClass)
Extracts heartbeat details from the last failed attempt.
|
<V> java.util.Optional<V> |
getHeartbeatDetails(java.lang.Class<V> detailsClass,
java.lang.reflect.Type detailsType)
Extracts heartbeat details from the last failed attempt.
|
ActivityInfo |
getInfo()
Information about activity invocation and the caller workflow
|
com.uber.m3.tally.Scope |
getMetricsScope() |
byte[] |
getTaskToken()
A correlation token that can be used to complete the activity asynchronously through
ActivityCompletionClient.complete(byte[], Object) . |
<V> void |
heartbeat(V details)
Use to notify Simple Workflow that activity execution is alive.
|
boolean |
isDoNotCompleteOnReturn() |
ActivityInfo getInfo()
<V> void heartbeat(V details) throws ActivityCompletionException
details
- In case of activity timeout details are returned as a field of the exception
thrown.ActivityCompletionException
- Indicates that activity cancellation was requested by the
workflow or any other reason for activity to stop execution. Should be rethrown from
activity implementation to indicate successful cancellation.<V> java.util.Optional<V> getHeartbeatDetails(java.lang.Class<V> detailsClass)
RetryOptions
on ActivityOptions
. If an
activity failed then the server would attempt to dispatch another activity task to retry
according to the retry options. If there was heartbeat details reported by the activity from
the failed attempt, the details would be delivered along with the activity task for the retry
attempt. The activity could extract the details by getHeartbeatDetails(Class)
() and
resume from the progress.detailsClass
- type of the heartbeat details<V> java.util.Optional<V> getHeartbeatDetails(java.lang.Class<V> detailsClass, java.lang.reflect.Type detailsType)
RetryOptions
on ActivityOptions
. If an
activity failed then the server would attempt to dispatch another activity task to retry
according to the retry options. If there was heartbeat details reported by the activity from
the failed attempt, the details would be delivered along with the activity task for the retry
attempt. The activity could extract the details by getHeartbeatDetails(Class)
() and
resume from the progress.detailsClass
- type of the heartbeat detailsbyte[] getTaskToken()
ActivityCompletionClient.complete(byte[], Object)
.void doNotCompleteOnReturn()
ActivityCompletionClient
.boolean isDoNotCompleteOnReturn()
com.uber.m3.tally.Scope getMetricsScope()