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() {
40
40
* Initialize
41
41
*/
42
42
public void init () {
43
- // Config
43
+ ArrayList < String > nodes = AppConfig . getInstance (). getCluster (). getNodes ();
44
44
Config config = new Config ();
45
- NetworkConfig networkConfig = config .getNetworkConfig ();
46
- networkConfig .setPort (AppConfig .getInstance ().getCluster ().getPort ());
47
- networkConfig .setPortCount (3 );
48
45
49
- // JoinConfig
46
+ // Init
47
+ NetworkConfig networkConfig = config .getNetworkConfig ();
50
48
JoinConfig joinConfig = networkConfig .getJoin ();
51
49
joinConfig .getMulticastConfig ().setEnabled (false );
50
+ if (nodes != null && nodes .size () > 0 ) {
52
51
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
+ }
59
61
60
62
// Instance
61
63
mHazelcastInstance = Hazelcast .newHazelcastInstance (config );
You can’t perform that action at this time.
0 commit comments