Move to URI in model and configuration

This commit is contained in:
Edward Capriolo
2016-06-02 09:23:55 -04:00
parent 3ca8e0f9c8
commit 5532585e67
16 changed files with 153 additions and 162 deletions

View File

@ -18,6 +18,7 @@
package org.apache.gossip;
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.util.List;
@ -45,8 +46,8 @@ public class GossipService {
*/
public GossipService(StartupSettings startupSettings) throws InterruptedException,
UnknownHostException {
this(startupSettings.getCluster(), InetAddress.getLocalHost().getHostAddress(), startupSettings
.getPort(), startupSettings.getId(), startupSettings.getGossipMembers(),
this(startupSettings.getCluster(), startupSettings.getUri()
, startupSettings.getId(), startupSettings.getGossipMembers(),
startupSettings.getGossipSettings(), null);
}
@ -56,18 +57,15 @@ public class GossipService {
* @throws InterruptedException
* @throws UnknownHostException
*/
public GossipService(String cluster, String ipAddress, int port, String id,
public GossipService(String cluster, URI uri, String id,
List<GossipMember> gossipMembers, GossipSettings settings, GossipListener listener)
throws InterruptedException, UnknownHostException {
gossipManager = new RandomGossipManager(cluster, ipAddress, port, id, settings, gossipMembers,
gossipManager = new RandomGossipManager(cluster, uri, id, settings, gossipMembers,
listener);
}
public void start() {
String address = get_gossipManager().getMyself().getHost() + ":"
+ get_gossipManager().getMyself().getPort();
LOGGER.debug("Starting: " + gossipManager.getName() + " - " + address);
LOGGER.debug("Starting: " + gossipManager.getName() + " - " + get_gossipManager().getMyself().getUri());
gossipManager.start();
}