@Override public InetSocketAddress getRemoteAddress() { // Both host and port may not be null in the model, no need to validate here // Don't do resolving here, let mod_cluster deal with it return new InetSocketAddress(binding.getUnresolvedDestinationAddress(), binding.getDestinationPort()); }
private URI getUri() throws URISyntaxException { OutboundSocketBinding binding = socketBinding.getValue(); return new URI(scheme, null, binding.getUnresolvedDestinationAddress(), binding.getDestinationPort(), path, null, null); }
@Override public boolean preferred(Node node) { OutboundSocketBinding binding = this.binding.get(); try { return binding.getResolvedDestinationAddress().equals(node.getSocketAddress().getAddress()) && (binding.getDestinationPort() == node.getSocketAddress().getPort()); } catch (UnknownHostException e) { throw new IllegalArgumentException(e); } } }
private InetSocketAddress getServerSocketAddress(ServerConfig server) throws StartException { final String ref = server.getOutgoingSocketBinding(); final OutboundSocketBinding binding = socketBindings.get(ref); if (binding == null) { throw MailLogger.ROOT_LOGGER.outboundSocketBindingNotAvailable(ref); } return new InetSocketAddress(binding.getUnresolvedDestinationAddress(), binding.getDestinationPort()); }
@Override public void accept(P protocol) { if (!this.bindings.isEmpty()) { List<A> initialHosts = new ArrayList<>(this.bindings.size()); for (Supplier<OutboundSocketBinding> bindingValue : this.bindings) { OutboundSocketBinding binding = bindingValue.get(); try { initialHosts.add(this.hostTransformer.apply(new InetSocketAddress(binding.getResolvedDestinationAddress(), binding.getDestinationPort()))); } catch (UnknownHostException e) { throw JGroupsLogger.ROOT_LOGGER.failedToResolveSocketBinding(e, binding); } } // In the absence of some common interface, we need to use reflection PrivilegedAction<Protocol> action = () -> protocol.setValue("initial_hosts", initialHosts); WildFlySecurityManager.doUnchecked(action); } } }
@Override public void accept(RemoteStoreConfigurationBuilder builder) { builder.remoteCacheName(this.remoteCacheName) .socketTimeout(this.socketTimeout) .tcpNoDelay(this.tcpNoDelay) ; for (Supplier<OutboundSocketBinding> bindingDependency : this.bindings) { OutboundSocketBinding binding = bindingDependency.get(); builder.addServer().host(binding.getUnresolvedDestinationAddress()).port(binding.getDestinationPort()); } } }
for (Supplier<OutboundSocketBinding> bindingDependency : bindingDependencies) { OutboundSocketBinding binding = bindingDependency.get(); builder.addServer().host(binding.getUnresolvedDestinationAddress()).port(binding.getDestinationPort()); for (Supplier<OutboundSocketBinding> bindingDependency : bindingDependencies) { OutboundSocketBinding binding = bindingDependency.get(); clusterConfigurationBuilder.addClusterNode(binding.getUnresolvedDestinationAddress(), binding.getDestinationPort());
@Override public int getPort() { return outboundSocketBinding.getDestinationPort(); } }
@Override public int getPort() { return outboundSocketBinding.getDestinationPort(); } }
@Override public InetSocketAddress getRemoteAddress() { // Both host and port may not be null in the model, no need to validate here // Don't do resolving here, let mod_cluster deal with it return new InetSocketAddress(binding.getUnresolvedDestinationAddress(), binding.getDestinationPort()); }
@Override public boolean preferred(Node node) { OutboundSocketBinding binding = this.binding.get(); try { return binding.getResolvedDestinationAddress().equals(node.getSocketAddress().getAddress()) && (binding.getDestinationPort() == node.getSocketAddress().getPort()); } catch (UnknownHostException e) { throw new IllegalArgumentException(e); } } }
private URI getUri() throws URISyntaxException { OutboundSocketBinding binding = socketBinding.getValue(); return new URI(scheme, null, binding.getUnresolvedDestinationAddress(), binding.getDestinationPort(), path, null, null); }
/** * Creates a {@link Socket} represented by this {@link OutboundSocketBinding} and connects to the * destination * * @return * @throws IOException */ public Socket connect() throws IOException { final Socket socket = this.createSocket(); final InetAddress destinationAddress = this.getResolvedDestinationAddress(); final int destinationPort = this.getDestinationPort(); final SocketAddress destination = new InetSocketAddress(destinationAddress, destinationPort); socket.connect(destination); return socket; }
/** * Creates a {@link Socket} represented by this {@link OutboundSocketBinding} and connects to the * destination. * * @return the created and connected socket * @throws IOException */ public Socket connect() throws IOException { final Socket socket = this.createSocket(); final InetAddress destinationAddress = this.getResolvedDestinationAddress(); final int destinationPort = this.getDestinationPort(); final SocketAddress destination = new InetSocketAddress(destinationAddress, destinationPort); socket.connect(destination); return socket; }
private URI getUri() throws URISyntaxException { OutboundSocketBinding binding = socketBinding.getValue(); return new URI(scheme, null, binding.getUnresolvedDestinationAddress(), binding.getDestinationPort(), path, null, null); }
/** * Creates a {@link Socket} represented by this {@link OutboundSocketBinding} and connects to the * destination * * @return * @throws IOException */ public Socket connect() throws IOException { final Socket socket = this.createSocket(); final InetAddress destinationAddress = this.getDestinationAddress(); final int destinationPort = this.getDestinationPort(); final SocketAddress destination = new InetSocketAddress(destinationAddress, destinationPort); socket.connect(destination); return socket; }
private InetSocketAddress getServerSocketAddress(ServerConfig server) throws StartException { final String ref = server.getOutgoingSocketBinding(); final OutboundSocketBinding binding = socketBindings.get(ref); if (ref == null) { throw MailMessages.MESSAGES.outboundSocketBindingNotAvailable(ref); } final InetAddress destinationAddress; try { destinationAddress = binding.getDestinationAddress(); } catch (UnknownHostException uhe) { throw MailMessages.MESSAGES.unknownOutboundSocketBindingDestination(uhe, ref); } return new InetSocketAddress(destinationAddress, binding.getDestinationPort()); }
@Override public void inject(OutboundSocketBinding value) { try { builder.host(value.getResolvedDestinationAddress().getHostAddress()).port(value.getDestinationPort()); // FIXME: add support for multiple hosts } catch (UnknownHostException e) { throw InfinispanMessages.MESSAGES.failedToInjectSocketBinding(e, value); } } };
@Override public void inject(OutboundSocketBinding value) { try { builder.addServer().host(value.getResolvedDestinationAddress().getHostAddress()).port(value.getDestinationPort()); } catch (UnknownHostException e) { throw InfinispanMessages.MESSAGES.failedToInjectSocketBinding(e, value); } } };
@Override public void accept(RemoteStoreConfigurationBuilder builder) { builder.remoteCacheName(this.remoteCacheName) .socketTimeout(this.socketTimeout) .tcpNoDelay(this.tcpNoDelay) ; for (Supplier<OutboundSocketBinding> bindingDependency : this.bindings) { OutboundSocketBinding binding = bindingDependency.get(); builder.addServer().host(binding.getUnresolvedDestinationAddress()).port(binding.getDestinationPort()); } } }