diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java b/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java index be1cc788..ca38aa17 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/CallerStarter.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-caller-starter package io.temporal.samples.nexus.caller; import io.temporal.api.common.v1.WorkflowExecution; @@ -34,3 +35,4 @@ public static void main(String[] args) { logger.info("Workflow result: {}", helloWorkflow.hello("Nexus", NexusService.Language.ES)); } } +// @@@SNIPEND \ No newline at end of file diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java b/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java index 55186489..149587f8 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/CallerWorker.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-caller-worker package io.temporal.samples.nexus.caller; import io.temporal.client.WorkflowClient; @@ -30,3 +31,4 @@ public static void main(String[] args) { factory.start(); } } +// @@@SNIPEND \ No newline at end of file diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflowImpl.java b/core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflowImpl.java index 94800877..49083301 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflowImpl.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/EchoCallerWorkflowImpl.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-caller-echo-workflow package io.temporal.samples.nexus.caller; import io.temporal.samples.nexus.service.NexusService; @@ -22,3 +23,4 @@ public String echo(String message) { return nexusService.echo(new NexusService.EchoInput(message)).getMessage(); } } +// @@@SNIPEND diff --git a/core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflowImpl.java b/core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflowImpl.java index f1612e35..55fc1ee5 100644 --- a/core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflowImpl.java +++ b/core/src/main/java/io/temporal/samples/nexus/caller/HelloCallerWorkflowImpl.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-caller-hello-workflow package io.temporal.samples.nexus.caller; import io.temporal.samples.nexus.service.NexusService; @@ -29,3 +30,4 @@ public String hello(String message, NexusService.Language language) { return handle.getResult().get().getMessage(); } } +// @@@SNIPEND diff --git a/core/src/main/java/io/temporal/samples/nexus/handler/HandlerWorker.java b/core/src/main/java/io/temporal/samples/nexus/handler/HandlerWorker.java index 3d8afa3d..7aafba4f 100644 --- a/core/src/main/java/io/temporal/samples/nexus/handler/HandlerWorker.java +++ b/core/src/main/java/io/temporal/samples/nexus/handler/HandlerWorker.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-handler-worker package io.temporal.samples.nexus.handler; import io.temporal.client.WorkflowClient; @@ -20,3 +21,4 @@ public static void main(String[] args) { factory.start(); } } +// @@@SNIPEND diff --git a/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java b/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java index 2344f27e..c051e0e1 100644 --- a/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java +++ b/core/src/main/java/io/temporal/samples/nexus/handler/NexusServiceImpl.java @@ -8,6 +8,7 @@ import io.temporal.nexus.WorkflowRunOperation; import io.temporal.samples.nexus.service.NexusService; +// @@@SNIPSTART samples-java-nexus-handler // To create a service implementation, annotate the class with @ServiceImpl and provide the // interface that the service implements. The service implementation class should have methods that // return OperationHandler that correspond to the operations defined in the service interface. @@ -51,3 +52,4 @@ public OperationHandler hello ::hello); } } +// @@@SNIPEND diff --git a/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java b/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java index 5d382eaa..0bcb12ab 100644 --- a/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java +++ b/core/src/main/java/io/temporal/samples/nexus/options/ClientOptions.java @@ -1,3 +1,4 @@ +// @@@SNIPSTART samples-java-nexus-cli package io.temporal.samples.nexus.options; import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; @@ -7,10 +8,14 @@ import io.temporal.client.WorkflowClientOptions; import io.temporal.serviceclient.WorkflowServiceStubs; import io.temporal.serviceclient.WorkflowServiceStubsOptions; +import org.apache.commons.cli.*; + +import javax.net.ssl.SSLException; import java.io.FileInputStream; import java.io.FileNotFoundException; import javax.net.ssl.SSLException; import org.apache.commons.cli.*; +import java.util.Arrays; public class ClientOptions { @@ -129,3 +134,4 @@ public static WorkflowClient getWorkflowClient( return WorkflowClient.newInstance(service, clientOptions.setNamespace(namespace).build()); } } +// @@@SNIPEND \ No newline at end of file diff --git a/core/src/main/java/io/temporal/samples/nexus/service/NexusService.java b/core/src/main/java/io/temporal/samples/nexus/service/NexusService.java index ad65b1b3..2f045f87 100644 --- a/core/src/main/java/io/temporal/samples/nexus/service/NexusService.java +++ b/core/src/main/java/io/temporal/samples/nexus/service/NexusService.java @@ -5,6 +5,7 @@ import io.nexusrpc.Operation; import io.nexusrpc.Service; +// @@@SNIPSTART samples-java-nexus-service @Service public interface NexusService { enum Language { @@ -85,3 +86,4 @@ public String getMessage() { @Operation EchoOutput echo(EchoInput input); } +// @@@SNIPEND diff --git a/core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/NexusServiceImpl.java b/core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/NexusServiceImpl.java index 20d55fed..38d8c52c 100644 --- a/core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/NexusServiceImpl.java +++ b/core/src/main/java/io/temporal/samples/nexusmultipleargs/handler/NexusServiceImpl.java @@ -9,6 +9,7 @@ import io.temporal.nexus.WorkflowRunOperation; import io.temporal.samples.nexus.service.NexusService; +// @@@SNIPSTART samples-java-nexus-handler-multiargs // To create a service implementation, annotate the class with @ServiceImpl and provide the // interface that the service implements. The service implementation class should have methods that // return OperationHandler that correspond to the operations defined in the service interface. @@ -58,3 +59,4 @@ public OperationHandler hello input.getLanguage())); } } +// @@@SNIPEND