this.hazelcastInstance = Hazelcast.newHazelcastInstance(config);
}
protected Config getHazelcastConfig() {
Config config;
this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
String configFile = properties.getProperty("hazelcastConfig");
if (configFile != null) {
try {
config = new XmlConfigBuilder(configFile).build();
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(configFile, e);
}
} else {
config = new XmlConfigBuilder().build();
RegistryConfig rc = new RegistryConfig(properties);
config.setPort(rc.getBindPort());
//config.setPortAutoIncrement(false);
if (!rc.getBindAddress().equals("*")) {
config.getNetworkConfig().getInterfaces().setEnabled(true);
config.getNetworkConfig().getInterfaces().clear();
config.getNetworkConfig().getInterfaces().addInterface(rc.getBindAddress());
}
config.getGroupConfig().setName(rc.getUserid());
config.getGroupConfig().setPassword(rc.getPassword());
if (rc.isMulticastDisabled()) {
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
} else {
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true);
config.getNetworkConfig().getJoin().getMulticastConfig().setMulticastPort(rc.getMulticastPort());
config.getNetworkConfig().getJoin().getMulticastConfig().setMulticastGroup(rc.getMulticastAddress());
}
if (rc.getWKAs().size() > 0) {
TcpIpConfig tcpconfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
tcpconfig.setEnabled(true);
List<Address> lsMembers = tcpconfig.getAddresses();
lsMembers.clear();
for (String addr : rc.getWKAs()) {
String[] ipNPort = addr.split(":");