final RemoteConnectionProviderFactory remoteConnectionProviderFactory = new RemoteConnectionProviderFactory(); endpoint.addConnectionProvider("remote", remoteConnectionProviderFactory, OptionMap.create(Options.SSL_ENABLED, Boolean.TRUE, Options.SSL_STARTTLS, Boolean.TRUE)); endpoint.addConnectionProvider("remote+tls", remoteConnectionProviderFactory, OptionMap.create(Options.SECURE, Boolean.TRUE));
RemotingConnector(JMXServiceURL serviceURL, Map<String, ?> environment) throws IOException { this.serviceUrl = serviceURL; this.environment = Collections.unmodifiableMap(environment); final Xnio xnio = Xnio.getInstance(); endpoint = Remoting.createEndpoint("endpoint", xnio, OptionMap.EMPTY); registration = endpoint.addConnectionProvider(CONNECTION_PROVIDER_URI, new RemoteConnectionProviderFactory(), OptionMap.EMPTY); }
static DomainControllerClientConfig create(final ExecutorService executorService, boolean destroyExecutor) throws IOException { final Endpoint endpoint = Remoting.createEndpoint(ENDPOINT_NAME, OptionMap.EMPTY); endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY); return new DomainControllerClientConfig(endpoint, executorService, destroyExecutor); }
private synchronized void createConnection() { try { endpoint = Remoting.createEndpoint("endpoint", OptionMap.EMPTY); endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE)); // open a connection final IoFuture<Connection> futureConnection = endpoint.connect(new URI(hostUrl), OptionMap.create(Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE, Options.SASL_POLICY_NOPLAINTEXT, Boolean.FALSE), callbackHandler); connection = IoFutureHelper.get(futureConnection, 30L, TimeUnit.SECONDS); final EJBClientContext ejbClientContext = EJBClientContext.create(); ejbClientContext.registerConnection(connection); this.clientContext = ejbClientContext; } catch (IOException e) { throw new RuntimeException(e); } catch (URISyntaxException e) { throw new RuntimeException(e); } }
/** {@inheritDoc} */ public synchronized void start(final StartContext context) throws StartException { final Endpoint endpoint; try { boolean ok = false; endpoint = Remoting.createEndpoint(endpointName, optionMap); try { // Reuse the options for the remote connection factory for now endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), optionMap); ok = true; } finally { if (! ok) { endpoint.closeAsync(); } } } catch (IOException e) { throw MESSAGES.couldNotStart(e); } this.endpoint = endpoint; }
endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY); endpoint.addConnectionProvider("http-remoting", new HttpUpgradeConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE)); endpoint.addConnectionProvider("https-remoting", new HttpUpgradeConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.TRUE));
public synchronized Endpoint get(final String endpointName, final OptionMap endPointCreationOptions, final OptionMap remoteConnectionProviderOptions) throws IOException { final CacheKey endpointHash = new CacheKey(remoteConnectionProviderOptions, endPointCreationOptions, endpointName); CacheEntry cacheEntry = cache.get(endpointHash); if (cacheEntry == null) { final Endpoint endpoint = Remoting.createEndpoint(endpointName, Xnio.getInstance(), endPointCreationOptions); endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), remoteConnectionProviderOptions); endpoint.addConnectionProvider("http-remoting", new HttpUpgradeConnectionProviderFactory(), OptionMap.builder().addAll(remoteConnectionProviderOptions).set(Options.SSL_ENABLED, Boolean.FALSE).getMap()); endpoint.addConnectionProvider("remote+http", new HttpUpgradeConnectionProviderFactory(), OptionMap.builder().addAll(remoteConnectionProviderOptions).set(Options.SSL_ENABLED, Boolean.FALSE).getMap()); endpoint.addConnectionProvider("https-remoting", new HttpUpgradeConnectionProviderFactory(), OptionMap.builder().addAll(remoteConnectionProviderOptions).set(Options.SSL_ENABLED, Boolean.TRUE).getMap()); endpoint.addConnectionProvider("remote+https", new HttpUpgradeConnectionProviderFactory(), OptionMap.builder().addAll(remoteConnectionProviderOptions).set(Options.SSL_ENABLED, Boolean.TRUE).getMap()); cacheEntry = new CacheEntry(endpoint, new EndpointWrapper(endpointHash, endpoint)); cache.putIfAbsent(endpointHash, cacheEntry); } cacheEntry.referenceCount.incrementAndGet(); return cacheEntry.endpointWrapper; }
final RemoteConnectionProviderFactory remoteConnectionProviderFactory = new RemoteConnectionProviderFactory(); endpoint.addConnectionProvider("remote", remoteConnectionProviderFactory, OptionMap.create(Options.SSL_ENABLED, Boolean.TRUE, Options.SSL_STARTTLS, Boolean.TRUE)); endpoint.addConnectionProvider("remote+tls", remoteConnectionProviderFactory, OptionMap.create(Options.SECURE, Boolean.TRUE));