/** * Create an endpoint with the given configuration and existing worker. * * @param endpointName the name of the endpoint * @param xnioWorker the XNIO worker instance to use * @param optionMap the options to configure the endpoint * @return the new endpoint * @throws IOException if an error occurs */ public static Endpoint createEndpoint(final String endpointName, final XnioWorker xnioWorker, final OptionMap optionMap) throws IOException { if (endpointName == null) { throw new IllegalArgumentException("endpointName is null"); } if (optionMap == null) { throw new IllegalArgumentException("optionMap is null"); } final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(CREATE_ENDPOINT_PERM); } EndpointBuilder builder = Endpoint.builder(); builder.setXnioWorker(xnioWorker); builder.setEndpointName(endpointName); // JBEAP-14783 - legacy endpoint return new LegacyEndpoint(builder.build()); }
static Endpoint parseEndpoint() throws ConfigXMLParseException, IOException { final ClientConfiguration clientConfiguration = ClientConfiguration.getInstance(); final EndpointBuilder builder = new EndpointBuilder(); builder.setXnioWorker(XnioWorker.getContextManager().get()); if (clientConfiguration != null) try (final ConfigurationXMLStreamReader streamReader = clientConfiguration.readConfiguration(Collections.singleton(NS_REMOTING_5_0))) { parseDocument(streamReader, builder); return builder.build(); } else { return null; } }
builder.setXnioWorker(xnioWorker); builder.setEndpointName(endpointName);
/** * Create an endpoint with the given configuration and existing worker. * * @param endpointName the name of the endpoint * @param xnioWorker the XNIO worker instance to use * @param optionMap the options to configure the endpoint * @return the new endpoint * @throws IOException if an error occurs */ public static Endpoint createEndpoint(final String endpointName, final XnioWorker xnioWorker, final OptionMap optionMap) throws IOException { if (endpointName == null) { throw new IllegalArgumentException("endpointName is null"); } if (optionMap == null) { throw new IllegalArgumentException("optionMap is null"); } final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(CREATE_ENDPOINT_PERM); } EndpointBuilder builder = Endpoint.builder(); builder.setXnioWorker(xnioWorker); builder.setEndpointName(endpointName); // JBEAP-14783 - legacy endpoint return new LegacyEndpoint(builder.build()); }
static Endpoint parseEndpoint() throws ConfigXMLParseException, IOException { final ClientConfiguration clientConfiguration = ClientConfiguration.getInstance(); final EndpointBuilder builder = new EndpointBuilder(); builder.setXnioWorker(XnioWorker.getContextManager().get()); if (clientConfiguration != null) try (final ConfigurationXMLStreamReader streamReader = clientConfiguration.readConfiguration(Collections.singleton(NS_REMOTING_5_0))) { parseDocument(streamReader, builder); return builder.build(); } else { return null; } }
builder.setXnioWorker(xnioWorker); builder.setEndpointName(endpointName);
/** {@inheritDoc} */ public void start(final StartContext context) throws StartException { final Endpoint endpoint; final EndpointBuilder builder = Endpoint.builder(); builder.setEndpointName(endpointName); builder.setXnioWorker(worker.getValue()); try { endpoint = builder.build(); } catch (IOException e) { throw RemotingLogger.ROOT_LOGGER.couldNotStart(e); } // Reuse the options for the remote connection factory for now this.endpoint = endpoint; }