Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFCORE-6873] Remoting: use subsystem type endpoint for outbound comm… #6055

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class EndpointService implements Service {

protected final String endpointName;
protected volatile Endpoint endpoint;
private final EndpointType type;
protected final OptionMap optionMap;
private final Consumer<Endpoint> endpointConsumer;
private final Supplier<XnioWorker> workerSupplier;
Expand All @@ -40,6 +41,7 @@ public EndpointService(final Consumer<Endpoint> endpointConsumer, final Supplier
nodeName = "remote";
}
endpointName = type == EndpointType.SUBSYSTEM ? nodeName : nodeName + ":" + type;
this.type = type;
this.optionMap = optionMap;
}

Expand All @@ -58,6 +60,9 @@ public void start(final StartContext context) throws StartException {
// Reuse the options for the remote connection factory for now
this.endpoint = endpoint;
endpointConsumer.accept(endpoint);
if (type == EndpointType.SUBSYSTEM) {
Endpoint.ENDPOINT_CONTEXT_MANAGER.setGlobalDefault(endpoint);
}
}

/** {@inheritDoc} */
Expand All @@ -73,6 +78,9 @@ public void stop(final StopContext context) {
context.complete();
});
}
if (type == EndpointType.SUBSYSTEM) {
Endpoint.ENDPOINT_CONTEXT_MANAGER.setGlobalDefault(null);
}
}

public enum EndpointType {
Expand Down
Loading