Skip to content

Commit 6105d49

Browse files
authored
Added thread interceptor (#120)
1 parent ba20701 commit 6105d49

40 files changed

+315
-265
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ updates:
33
- package-ecosystem: "gradle"
44
directory: "/"
55
schedule:
6-
interval: "daily"
6+
interval: "weekly"
77
- package-ecosystem: "github-actions"
88
directory: "/"
99
schedule:
10-
interval: "daily"
10+
interval: "weekly"

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
22
dependencies {
3-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.11'
3+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
44
}
55
}
66

77
plugins {
88
id 'com.github.sherter.google-java-format' version '0.9'
9-
id 'com.google.protobuf' version '0.8.11'
9+
id 'com.google.protobuf' version '0.8.12'
1010
id 'java-library'
1111
id 'net.ltgt.errorprone' version '1.2.1'
1212
id 'net.minecrell.licenser' version '0.4.1'
@@ -92,17 +92,17 @@ dependencies {
9292
errorprone('com.google.errorprone:error_prone_core:2.4.0')
9393

9494
api group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
95-
api group: 'com.uber.m3', name: 'tally-core', version: '0.4.0'
95+
api group: 'com.uber.m3', name: 'tally-core', version: '0.6.1'
9696
api group: 'io.micrometer', name: 'micrometer-core', version: '1.5.1'
97-
api group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
97+
api group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
9898
api 'io.grpc:grpc-protobuf:1.30.1'
9999
api 'io.grpc:grpc-stub:1.30.1'
100100

101101
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
102-
implementation group: 'com.cronutils', name: 'cron-utils', version: '9.0.0'
102+
implementation group: 'com.cronutils', name: 'cron-utils', version: '9.0.2'
103103
implementation 'io.grpc:grpc-netty-shaded:1.30.1'
104-
implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.12.1'
105-
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.3'
104+
implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.12.2'
105+
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.0'
106106
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.11.0'
107107

108108

@@ -136,7 +136,7 @@ jar {
136136

137137
protobuf {
138138
protoc {
139-
artifact = 'com.google.protobuf:protoc:3.11.0'
139+
artifact = 'com.google.protobuf:protoc:3.12.3'
140140
}
141141
plugins {
142142
grpc {

src/main/java/io/temporal/client/WorkflowClientOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import io.temporal.common.context.ContextPropagator;
2323
import io.temporal.common.converter.DataConverter;
24+
import io.temporal.common.interceptors.WorkflowClientInterceptor;
2425
import io.temporal.enums.v1.QueryRejectCondition;
2526
import java.lang.management.ManagementFactory;
2627
import java.util.Arrays;

src/main/java/io/temporal/common/interceptors/NoopWorkflowInterceptor.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main/java/io/temporal/client/WorkflowClientInterceptor.java renamed to src/main/java/io/temporal/common/interceptors/WorkflowClientInterceptor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
* permissions and limitations under the License.
1818
*/
1919

20-
package io.temporal.client;
20+
package io.temporal.common.interceptors;
2121

22+
import io.temporal.client.ActivityCompletionClient;
23+
import io.temporal.client.WorkflowOptions;
24+
import io.temporal.client.WorkflowStub;
2225
import io.temporal.common.v1.WorkflowExecution;
2326
import java.util.Optional;
2427

src/main/java/io/temporal/client/WorkflowClientInterceptorBase.java renamed to src/main/java/io/temporal/common/interceptors/WorkflowClientInterceptorBase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
* permissions and limitations under the License.
1818
*/
1919

20-
package io.temporal.client;
20+
package io.temporal.common.interceptors;
2121

22+
import io.temporal.client.ActivityCompletionClient;
23+
import io.temporal.client.WorkflowOptions;
24+
import io.temporal.client.WorkflowStub;
2225
import io.temporal.common.v1.WorkflowExecution;
2326
import java.util.Optional;
2427

28+
/** Convenience base class for WorkflowClientInterceptor implementations. */
2529
public class WorkflowClientInterceptorBase implements WorkflowClientInterceptor {
2630

2731
@Override

src/main/java/io/temporal/common/interceptors/WorkflowInvocationInterceptor.java renamed to src/main/java/io/temporal/common/interceptors/WorkflowInboundCallsInterceptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* Intercepts calls to the workflow execution. Executes under workflow context. So all the
2424
* restrictions on the workflow code should be obeyed.
2525
*/
26-
public interface WorkflowInvocationInterceptor {
26+
public interface WorkflowInboundCallsInterceptor {
2727
/**
28-
* Called when workflow class is intantiated.
28+
* Called when workflow class is instantiated.
2929
*
30-
* @param interceptor interceptor for calls that workflow makes
30+
* @param outboundCalls interceptor for calls that workflow makes to the SDK
3131
*/
32-
void init(WorkflowCallsInterceptor interceptor);
32+
void init(WorkflowOutboundCallsInterceptor outboundCalls);
3333

3434
/**
3535
* Called when workflow main method is called.

src/main/java/io/temporal/common/interceptors/BaseWorkflowInvoker.java renamed to src/main/java/io/temporal/common/interceptors/WorkflowInboundCallsInterceptorBase.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@
1919

2020
package io.temporal.common.interceptors;
2121

22-
public class BaseWorkflowInvoker implements WorkflowInvoker {
23-
private final WorkflowInvocationInterceptor next;
24-
private final WorkflowCallsInterceptor interceptor;
22+
/** Convenience base class for WorkflowInboundCallsInterceptor implementations. */
23+
public class WorkflowInboundCallsInterceptorBase implements WorkflowInboundCallsInterceptor {
24+
private final WorkflowInboundCallsInterceptor next;
2525

26-
public BaseWorkflowInvoker(
27-
WorkflowCallsInterceptor interceptor, WorkflowInvocationInterceptor next) {
26+
public WorkflowInboundCallsInterceptorBase(WorkflowInboundCallsInterceptor next) {
2827
this.next = next;
29-
this.interceptor = interceptor;
3028
}
3129

3230
@Override
33-
public void init() {
34-
next.init(interceptor);
31+
public void init(WorkflowOutboundCallsInterceptor outboundCalls) {
32+
next.init(outboundCalls);
3533
}
3634

3735
@Override

src/main/java/io/temporal/common/interceptors/WorkflowInterceptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
* <p>TODO(maxim): JavaDoc with sample
2626
*/
2727
public interface WorkflowInterceptor {
28-
WorkflowInvoker interceptExecuteWorkflow(
29-
WorkflowCallsInterceptor interceptor, WorkflowInvocationInterceptor next);
28+
WorkflowInboundCallsInterceptor interceptWorkflow(WorkflowInboundCallsInterceptor next);
3029
}

src/main/java/io/temporal/common/interceptors/WorkflowInvoker.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)