private String createConfig() { Config memberConfig = options.memberConfig; if (memberConfig == null) { return null; } memberConfig.getGroupConfig().setName("workers"); memberConfig.setProperty("hazelcast.phone.home.enabled", "false"); NetworkConfig networkConfig = memberConfig.getNetworkConfig(); networkConfig.setPortAutoIncrement(true); networkConfig.setPort(PORT); networkConfig.setPortCount(PORT_COUNT); networkConfig.getJoin().getMulticastConfig().setEnabled(false); networkConfig.getJoin().getTcpIpConfig().setEnabled(true); ConfigXmlGenerator generator = new ConfigXmlGenerator(true); String configString = generator.generate(memberConfig); if (networkConfig.getJoin().getTcpIpConfig().getMembers().isEmpty()) { configString = configString.replace("<member-list/>", "<!--MEMBERS-->"); } configString = fixGroup(configString); System.out.println("HZ Configuration:\n" + configString); return configString; }
public void writeResponse(ManagementCenterService mcs, DataOutput dos) throws Exception { String clusterXml; clusterXml = new ConfigXmlGenerator(true).generate(mcs.getHazelcastInstance().getConfig()); dos.writeUTF(clusterXml); }