-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathActivityMethod.java
78 lines (69 loc) · 3.01 KB
/
ActivityMethod.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Modifications Copyright (c) 2017-2020 Uber Technologies Inc.
* Portions of the Software are attributed to Copyright (c) 2020 Temporal Technologies Inc.
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License is
* located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.uber.cadence.activity;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.time.Duration;
/**
* Indicates that the method is an activity method. This annotation applies only to activity
* interface methods. Not required. Use it to override default activity type name.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ActivityMethod {
/** Name of the workflow type. Default is {short class name}::{method name} */
String name() default "";
/**
* Overall timeout workflow is willing to wait for activity to complete. It includes time in a
* task list (use {@link #scheduleToStartTimeoutSeconds()} to limit it) plus activity execution
* time (use {@link #startToCloseTimeoutSeconds()} to limit it). Either this option or both
* schedule to start and start to close are required.
*
* @deprecated use {@link ActivityOptions.Builder#setScheduleToCloseTimeout(Duration)} instead.
*/
int scheduleToCloseTimeoutSeconds() default 0;
/**
* Time activity can stay in task list before it is picked up by a worker. If schedule to close is
* not provided then both this and start to close are required.
*
* @deprecated use {@link ActivityOptions.Builder#setScheduleToStartTimeout(Duration)} instead.
*/
int scheduleToStartTimeoutSeconds() default 0;
/**
* Maximum activity execution time after it was sent to a worker. If schedule to close is not
* provided then both this and schedule to start are required.
*
* @deprecated use {@link ActivityOptions.Builder#setStartToCloseTimeout(Duration)} instead.
*/
int startToCloseTimeoutSeconds() default 0;
/**
* Heartbeat interval. Activity must heartbeat before this interval passes after a last heartbeat
* or activity start.
*
* @deprecated use {@link ActivityOptions.Builder#setHeartbeatTimeout(Duration)} instead.
*/
int heartbeatTimeoutSeconds() default 0;
/**
* Task list to use when dispatching activity task to a worker. By default it is the same task
* list name the workflow was started with.
*
* @deprecated use {@link ActivityOptions.Builder#setTaskList(String)} instead.
*/
String taskList() default "";
}