Package com.hazelcast.cluster.client

Examples of com.hazelcast.cluster.client.MemberAttributeChange


                } else if (event.getEventType() == ClientMembershipEvent.MEMBER_REMOVED) {
                    members.remove(member);
                    membersUpdated = true;
//                    getConnectionManager().removeConnectionPool(member.getAddress()); //TODO
                } else if (event.getEventType() == ClientMembershipEvent.MEMBER_ATTRIBUTE_CHANGED) {
                    MemberAttributeChange memberAttributeChange = event.getMemberAttributeChange();
                    Map<Address, MemberImpl> memberMap = membersRef.get();
                    if (memberMap != null) {
                        for (MemberImpl target : memberMap.values()) {
                            if (target.getUuid().equals(memberAttributeChange.getUuid())) {
                                final MemberAttributeOperationType operationType = memberAttributeChange.getOperationType();
                                final String key = memberAttributeChange.getKey();
                                final Object value = memberAttributeChange.getValue();
                                target.updateAttribute(operationType, key, value);
                                MemberAttributeEvent memberAttributeEvent = new MemberAttributeEvent(
                                        client.getCluster(), target, operationType, key, value);
                                fireMemberAttributeEvent(memberAttributeEvent);
                                break;
View Full Code Here


            } else if (event.getEventType() == ClientMembershipEvent.MEMBER_REMOVED) {
                members.remove(member);
                membersUpdated = true;
//                    getConnectionManager().removeConnectionPool(member.getAddress()); //TODO
            } else if (event.getEventType() == ClientMembershipEvent.MEMBER_ATTRIBUTE_CHANGED) {
                MemberAttributeChange memberAttributeChange = event.getMemberAttributeChange();
                Map<Address, MemberImpl> memberMap = clusterService.getMembersRef();
                if (memberMap != null) {
                    for (MemberImpl target : memberMap.values()) {
                        if (target.getUuid().equals(memberAttributeChange.getUuid())) {
                            final MemberAttributeOperationType operationType = memberAttributeChange.getOperationType();
                            final String key = memberAttributeChange.getKey();
                            final Object value = memberAttributeChange.getValue();
                            target.updateAttribute(operationType, key, value);
                            MemberAttributeEvent memberAttributeEvent = new MemberAttributeEvent(
                                    client.getCluster(), target, operationType, key, value);
                            clusterService.fireMemberAttributeEvent(memberAttributeEvent);
                            break;
View Full Code Here

            } else if (event.getEventType() == ClientMembershipEvent.MEMBER_REMOVED) {
                members.remove(member);
                membersUpdated = true;
                connectionManager.removeEndpoint(member.getAddress());
            } else if (event.getEventType() == ClientMembershipEvent.MEMBER_ATTRIBUTE_CHANGED) {
                MemberAttributeChange memberAttributeChange = event.getMemberAttributeChange();
                Map<Address, MemberImpl> memberMap = clusterService.getMembersRef();
                if (memberMap != null) {
                    for (MemberImpl target : memberMap.values()) {
                        if (target.getUuid().equals(memberAttributeChange.getUuid())) {
                            final MemberAttributeOperationType operationType = memberAttributeChange.getOperationType();
                            final String key = memberAttributeChange.getKey();
                            final Object value = memberAttributeChange.getValue();
                            target.updateAttribute(operationType, key, value);
                            MemberAttributeEvent memberAttributeEvent = new MemberAttributeEvent(
                                    client.getCluster(), target, operationType, key, value);
                            clusterService.fireMemberAttributeEvent(memberAttributeEvent);
                            break;
View Full Code Here

TOP

Related Classes of com.hazelcast.cluster.client.MemberAttributeChange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.