HazelcastNodeStatus(final Member member_) { super( member_.getUuid(), member_.isLiteMember() ? "client" : "node", member_.getInetSocketAddress().toString()); member = member_; }
public static void main(String[] args) throws Exception { HazelcastInstance hz = Hazelcast.newHazelcastInstance(); Cluster cluster = hz.getCluster(); cluster.addMembershipListener(new MembershipListener() { @Override public void memberAdded(MembershipEvent membershipEvent) { System.out.println( "********** MemberAdded " + membershipEvent ); } @Override public void memberRemoved(MembershipEvent membershipEvent) { System.out.println( "********** MemberRemoved " + membershipEvent ); } @Override public void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent) { System.out.println( "********** MemberAttributeChanged " + memberAttributeEvent ); } }); Member localMember = cluster.getLocalMember(); System.out.println ( "********** my inetAddress= " + localMember.getInetSocketAddress() ); }
@Test public void testInstance() { assertNotNull(instance); final Set<Member> members = instance.getCluster().getMembers(); assertEquals(1, members.size()); final Member member = members.iterator().next(); final InetSocketAddress inetSocketAddress = member.getInetSocketAddress(); assertEquals(5700, inetSocketAddress.getPort()); assertEquals("test-instance", config.getInstanceName()); assertEquals("HAZELCAST_ENTERPRISE_LICENSE_KEY", config.getLicenseKey()); }