}
public void init() {
+ String schemeStr = System.getProperty("connection.scheme");
this.connectionEvents = new LinkedBlockingQueue<ConnectionMgmtEvent>();
schemes = new ConcurrentHashMap<ConnectionMgmtScheme, AbstractScheme>();
for (ConnectionMgmtScheme scheme : ConnectionMgmtScheme.values()) {
AbstractScheme schemeImpl = SchemeFactory.getScheme(scheme, clusterServices);
- if (schemeImpl != null) schemes.put(scheme, schemeImpl);
+ if (schemeImpl != null) {
+ schemes.put(scheme, schemeImpl);
+ if (scheme.name().equalsIgnoreCase(schemeStr)) {
+ activeScheme = scheme;
+ }
+ }
}
}
String controller = ci.nextArgument();
if (controller == null) {
ci.println("Nodes connected to this controller : ");
- if (this.getLocalNodes() == null) ci.println("None");
- else ci.println(this.getLocalNodes().toString());
+ if (this.getLocalNodes() == null) {
+ ci.println("None");
+ } else {
+ ci.println(this.getLocalNodes().toString());
+ }
return;
}
try {
InetAddress address = InetAddress.getByName(controller);
ci.println("Nodes connected to controller "+controller);
- if (this.getNodes(address) == null) ci.println("None");
- else ci.println(this.getNodes(address).toString());
- return;
+ if (this.getNodes(address) == null) {
+ ci.println("None");
+ } else {
+ ci.println(this.getNodes(address).toString());
+ }
} catch (UnknownHostException e) {
- e.printStackTrace();
+ logger.error("An error occured",e);
}
}