20
20
import com .uber .cadence .WorkflowExecution ;
21
21
import com .uber .cadence .activity .ActivityOptions ;
22
22
import com .uber .cadence .workflow .*;
23
+
24
+ import java .lang .reflect .Type ;
23
25
import java .time .Duration ;
24
26
import java .util .Objects ;
25
27
import java .util .Optional ;
@@ -35,24 +37,22 @@ public class SignalWorkflowInterceptor implements WorkflowInterceptor {
35
37
private Function <String , String > overrideSignalName ;
36
38
private final WorkflowInterceptor next ;
37
39
38
- public SignalWorkflowInterceptor (Function <Object [],Object []> overrideArgs ,
39
- Function <String ,String > overrideSignalName ,
40
+ public SignalWorkflowInterceptor (Function <Object [], Object []> overrideArgs ,
41
+ Function <String , String > overrideSignalName ,
40
42
WorkflowInterceptor next ) {
41
43
this .overrideArgs = overrideArgs ;
42
44
this .overrideSignalName = overrideSignalName ;
43
45
this .next = Objects .requireNonNull (next );
44
46
}
45
47
46
48
@ Override
47
- public <R > Promise <R > executeActivity (
48
- String activityName , Class <R > returnType , Object [] args , ActivityOptions options ) {
49
- return next .executeActivity (activityName , returnType , args , options );
49
+ public <R > Promise <R > executeActivity (String activityName , Class <R > resultClass , Type resultType , Object [] args , ActivityOptions options ) {
50
+ return next .executeActivity (activityName , resultClass , resultType , args , options );
50
51
}
51
52
52
53
@ Override
53
- public <R > WorkflowResult <R > executeChildWorkflow (
54
- String workflowType , Class <R > returnType , Object [] args , ChildWorkflowOptions options ) {
55
- return next .executeChildWorkflow (workflowType , returnType , args , options );
54
+ public <R > WorkflowResult <R > executeChildWorkflow (String workflowType , Class <R > resultClass , Type resultType , Object [] args , ChildWorkflowOptions options ) {
55
+ return next .executeChildWorkflow (workflowType , resultClass , resultType , args , options );
56
56
}
57
57
58
58
@ Override
@@ -63,8 +63,8 @@ public Random newRandom() {
63
63
@ Override
64
64
public Promise <Void > signalExternalWorkflow (
65
65
WorkflowExecution execution , String signalName , Object [] args ) {
66
- if (args != null && args .length > 0 ){
67
- args = new Object [] {"corrupted signal" };
66
+ if (args != null && args .length > 0 ) {
67
+ args = new Object []{"corrupted signal" };
68
68
}
69
69
return next .signalExternalWorkflow (execution , overrideSignalName .apply (signalName ), overrideArgs .apply (args ));
70
70
}
@@ -95,14 +95,13 @@ public Promise<Void> newTimer(Duration duration) {
95
95
}
96
96
97
97
@ Override
98
- public <R > R sideEffect (Class <R > resultType , Functions .Func <R > func ) {
99
- return next .sideEffect (resultType , func );
98
+ public <R > R sideEffect (Class <R > resultClass , Type resultType , Functions .Func <R > func ) {
99
+ return next .sideEffect (resultClass , resultType , func );
100
100
}
101
101
102
102
@ Override
103
- public <R > R mutableSideEffect (
104
- String id , Class <R > returnType , BiPredicate <R , R > updated , Functions .Func <R > func ) {
105
- return next .mutableSideEffect (id , returnType , updated , func );
103
+ public <R > R mutableSideEffect (String id , Class <R > resultClass , Type resultType , BiPredicate <R , R > updated , Functions .Func <R > func ) {
104
+ return null ;
106
105
}
107
106
108
107
@ Override
@@ -117,8 +116,7 @@ public void continueAsNew(
117
116
}
118
117
119
118
@ Override
120
- public void registerQuery (
121
- String queryType , Class <?>[] argTypes , Functions .Func1 <Object [], Object > callback ) {
119
+ public void registerQuery (String queryType , Type [] argTypes , Functions .Func1 <Object [], Object > callback ) {
122
120
next .registerQuery (queryType , argTypes , callback );
123
121
}
124
122
0 commit comments