21
21
package io .temporal .internal .activity ;
22
22
23
23
import com .uber .m3 .tally .Scope ;
24
+ import io .temporal .client .WorkflowClient ;
24
25
import io .temporal .common .converter .DataConverter ;
25
26
import io .temporal .internal .client .external .ManualActivityCompletionClientFactory ;
26
- import io .temporal .serviceclient .WorkflowServiceStubs ;
27
27
import java .time .Duration ;
28
28
import java .util .Objects ;
29
29
import java .util .concurrent .ScheduledExecutorService ;
30
30
31
31
public class ActivityExecutionContextFactoryImpl implements ActivityExecutionContextFactory {
32
- private final WorkflowServiceStubs service ;
32
+ private final WorkflowClient client ;
33
33
private final String identity ;
34
34
private final String namespace ;
35
35
private final Duration maxHeartbeatThrottleInterval ;
@@ -39,14 +39,14 @@ public class ActivityExecutionContextFactoryImpl implements ActivityExecutionCon
39
39
private final ManualActivityCompletionClientFactory manualCompletionClientFactory ;
40
40
41
41
public ActivityExecutionContextFactoryImpl (
42
- WorkflowServiceStubs service ,
42
+ WorkflowClient client ,
43
43
String identity ,
44
44
String namespace ,
45
45
Duration maxHeartbeatThrottleInterval ,
46
46
Duration defaultHeartbeatThrottleInterval ,
47
47
DataConverter dataConverter ,
48
48
ScheduledExecutorService heartbeatExecutor ) {
49
- this .service = Objects .requireNonNull (service );
49
+ this .client = Objects .requireNonNull (client );
50
50
this .identity = identity ;
51
51
this .namespace = Objects .requireNonNull (namespace );
52
52
this .maxHeartbeatThrottleInterval = Objects .requireNonNull (maxHeartbeatThrottleInterval );
@@ -56,14 +56,14 @@ public ActivityExecutionContextFactoryImpl(
56
56
this .heartbeatExecutor = Objects .requireNonNull (heartbeatExecutor );
57
57
this .manualCompletionClientFactory =
58
58
ManualActivityCompletionClientFactory .newFactory (
59
- service , namespace , identity , dataConverter );
59
+ client . getWorkflowServiceStubs () , namespace , identity , dataConverter );
60
60
}
61
61
62
62
@ Override
63
63
public InternalActivityExecutionContext createContext (
64
64
ActivityInfoInternal info , Scope metricsScope ) {
65
65
return new ActivityExecutionContextImpl (
66
- service ,
66
+ client ,
67
67
namespace ,
68
68
info ,
69
69
dataConverter ,
0 commit comments