@Test public void testIsAlwaysMaster() throws Exception { assertThat("Expecting isMaster=true, when Hazelcast is not running", cluster.isMaster(), equalTo(true)); verify(shutdownHook, times(0)).registerOperation(any()); }
public boolean isMaster() { if (!clusterEnabled) { return true; } guardAgainstInitializationFailures(); Set<Member> members = hazelcast.getCluster().getMembers(); Member member = members.iterator().next(); return member.localMember(); }
Cluster { public boolean isMaster() { if (!clusterEnabled) { return true; } guardAgainstInitializationFailures(); Set<Member> members = hazelcast.getCluster().getMembers(); Member member = members.iterator().next(); return member.localMember(); } }
Cluster { public boolean isMaster() { if (!clusterEnabled) { return true; } guardAgainstInitializationFailures(); Set<Member> members = hazelcast.getCluster().getMembers(); Member member = members.iterator().next(); return member.localMember(); } @Inject  Cluster(AppConfig appConfig, ShutdownHook shutdownHook); }
Cluster { public boolean isMaster() { if (!clusterEnabled) { return true; } guardAgainstInitializationFailures(); Set<Member> members = hazelcast.getCluster().getMembers(); Member member = members.iterator().next(); return member.localMember(); } @Inject  Cluster(AppConfig appConfig, ShutdownHook shutdownHook); void registerListener(MembershipListener membershipListener); void registerListener(MigrationListener clusterMigrationListener); IMap<K, V> distributedMap(String name); boolean isMaster(); boolean isEnabled(); }
Cluster { public boolean isMaster() { if (!clusterEnabled) { return true; } guardAgainstInitializationFailures(); Set<Member> members = hazelcast.getCluster().getMembers(); Member member = members.iterator().next(); return member.localMember(); } @Inject  Cluster(AppConfig appConfig, ShutdownHook shutdownHook); void registerListener(MembershipListener membershipListener); void registerListener(MigrationListener clusterMigrationListener); IMap<K, V> distributedMap(String name); boolean isMaster(); boolean isEnabled();  }