private void configureMulticastSocket( ProtocolConfiguration protocol, org.jgroups.conf.ProtocolConfiguration config, String addressProperty, String portProperty, SocketBinding binding) { Map<String, String> properties = config.getProperties(); try { InetSocketAddress mcastSocketAddress = binding.getMulticastSocketAddress(); if (protocol.hasProperty(addressProperty)) { properties.put(addressProperty, mcastSocketAddress.getAddress().getHostAddress()); } if (protocol.hasProperty(portProperty)) { properties.put(portProperty, String.valueOf(mcastSocketAddress.getPort())); } } catch (IllegalStateException e) { ROOT_LOGGER.tracef( e, "Could not set %s.%s and %s.%s, %s socket binding does not specify a multicast socket", config.getProtocolName(), addressProperty, config.getProtocolName(), portProperty, binding.getName()); } }
private void configureServerSocket( ProtocolConfiguration protocol, org.jgroups.conf.ProtocolConfiguration config, String property, SocketBinding binding) { if (protocol.hasProperty(property)) { config.getProperties().put(property, String.valueOf(binding.getSocketAddress().getPort())); } }
private void configureBindAddress( ProtocolConfiguration protocol, org.jgroups.conf.ProtocolConfiguration config, SocketBinding binding) { final String property = "bind_addr"; if (protocol.hasProperty(property)) { config .getProperties() .put(property, binding.getSocketAddress().getAddress().getHostAddress()); } }