File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
src/main/java/org/code13k/heets/app Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,24 @@ private Cluster() {
4040 * Initialize
4141 */
4242 public void init () {
43- // Config
43+ ArrayList < String > nodes = AppConfig . getInstance (). getCluster (). getNodes ();
4444 Config config = new Config ();
45- NetworkConfig networkConfig = config .getNetworkConfig ();
46- networkConfig .setPort (AppConfig .getInstance ().getCluster ().getPort ());
47- networkConfig .setPortCount (3 );
4845
49- // JoinConfig
46+ // Init
47+ NetworkConfig networkConfig = config .getNetworkConfig ();
5048 JoinConfig joinConfig = networkConfig .getJoin ();
5149 joinConfig .getMulticastConfig ().setEnabled (false );
50+ if (nodes != null && nodes .size () > 0 ) {
5251
53- // TcpIpConfig
54- TcpIpConfig tcpIpConfig = joinConfig .getTcpIpConfig ();
55- ArrayList <String > nodes = AppConfig .getInstance ().getCluster ().getNodes ();
56- tcpIpConfig .setMembers (nodes );
57- tcpIpConfig .setRequiredMember (null );
58- tcpIpConfig .setEnabled (true );
52+ // Port
53+ networkConfig .setPort (AppConfig .getInstance ().getCluster ().getPort ());
54+
55+ // TcpIpConfig
56+ TcpIpConfig tcpIpConfig = joinConfig .getTcpIpConfig ();
57+ tcpIpConfig .setMembers (nodes );
58+ tcpIpConfig .setRequiredMember (null );
59+ tcpIpConfig .setEnabled (true );
60+ }
5961
6062 // Instance
6163 mHazelcastInstance = Hazelcast .newHazelcastInstance (config );
You can’t perform that action at this time.
0 commit comments