@@ -21,22 +21,22 @@ public class InternalNexusOperationContext {
2121 // Link returned by the StartWorkflowExecution response when the operation is backed by a workflow
2222 // (workflow-run operations). Read by NexusStartWorkflowHelper to attach the forward
2323 // operation->workflow link, fabricating a WORKFLOW_EXECUTION_STARTED link when the server omits
24- // one. Distinct from the signal backlinks below.
24+ // one. Distinct from the response links below.
2525 Link startWorkflowResponseLink ;
2626 // Links extracted from the inbound Nexus task. Stored once at the task-handler boundary so the
2727 // workflow client can attach them to the outgoing requests it issues (e.g. signal,
2828 // signalWithStart) via the request's links field.
29- private List <Link > nexusOperationLinks = Collections .emptyList ();
30- // Backlinks returned by outbound RPCs the operation handler issues (such as
29+ private List <Link > requestLinks = Collections .emptyList ();
30+ // Links returned by outbound RPCs the operation handler issues (such as
3131 // SignalWorkflowExecutionResponse.link or SignalWithStartWorkflowExecutionResponse.signal_link).
3232 // One entry per outbound RPC that returned a link. Drained
3333 // by the task handler when building StartOperationResponse so each RPC the handler issued gets a
3434 // corresponding link on the caller workflow's history event.
3535 //
3636 // A handler may issue RPCs from multiple threads, so every read and write of this list is guarded
37- // by backlinksLock and getBacklinks () returns a defensive copy taken under the lock.
38- private final Object backlinksLock = new Object ();
39- private final List <Link > responseBacklinks = new ArrayList <>();
37+ // by responseLinksLock and getResponseLinks () returns a defensive copy taken under the lock.
38+ private final Object responseLinksLock = new Object ();
39+ private final List <Link > responseLinks = new ArrayList <>();
4040
4141 public InternalNexusOperationContext (
4242 String namespace ,
@@ -86,13 +86,13 @@ public NexusOperationContext getUserFacingContext() {
8686 * Set the {@code common.v1.Link}s extracted from the inbound Nexus task so they can be attached
8787 * to RPCs issued by the operation handler.
8888 */
89- public void setNexusOperationLinks (List <Link > links ) {
90- this .nexusOperationLinks = links == null ? Collections .emptyList () : links ;
89+ public void setRequestLinks (List <Link > links ) {
90+ this .requestLinks = links == null ? Collections .emptyList () : links ;
9191 }
9292
9393 /** Links from the inbound Nexus task; empty if none. */
94- public @ Nonnull List <Link > getNexusOperationLinks () {
95- return Collections .unmodifiableList (nexusOperationLinks );
94+ public @ Nonnull List <Link > getRequestLinks () {
95+ return Collections .unmodifiableList (requestLinks );
9696 }
9797
9898 public void setStartWorkflowResponseLink (Link link ) {
@@ -104,28 +104,28 @@ public Link getStartWorkflowResponseLink() {
104104 }
105105
106106 /**
107- * Append a backlink returned by an outbound RPC the operation handler issued (e.g. signal,
107+ * Append a response link returned by an outbound RPC the operation handler issued (e.g. signal,
108108 * signalWithStart, etc). The task handler drains the list when building the operation's
109109 * StartOperationResponse.
110110 */
111- public void addBacklink (Link link ) {
111+ public void addResponseLink (Link link ) {
112112 if (link != null ) {
113- synchronized (backlinksLock ) {
114- responseBacklinks .add (link );
113+ synchronized (responseLinksLock ) {
114+ responseLinks .add (link );
115115 }
116116 }
117117 }
118118
119119 /**
120- * Backlinks from every outbound RPC the handler issued. Returned as an unmodifiable view; callers
121- * must not attempt to mutate. Entries are accumulated while the operation handler runs (the call
122- * that flows through {@link
120+ * Response links from every outbound RPC the handler issued. Returned as an unmodifiable view;
121+ * callers must not attempt to mutate. Entries are accumulated while the operation handler runs
122+ * (the call that flows through {@link
123123 * io.temporal.common.interceptors.NexusOperationInboundCallsInterceptor#startOperation}) and are
124124 * drained afterward by the task handler when building the StartOperationResponse.
125125 */
126- public @ Nonnull List <Link > getBacklinks () {
127- synchronized (backlinksLock ) {
128- return Collections .unmodifiableList (new ArrayList <>(responseBacklinks ));
126+ public @ Nonnull List <Link > getResponseLinks () {
127+ synchronized (responseLinksLock ) {
128+ return Collections .unmodifiableList (new ArrayList <>(responseLinks ));
129129 }
130130 }
131131
0 commit comments