Package org.apache.axis2.clustering

Examples of org.apache.axis2.clustering.Member


            String uuid = hazelcastMember.getUuid();
            log.info("Member left [" + uuid + "]: " +
                     hazelcastMember.getInetSocketAddress().toString());

            // If the member who left is a WKA member, try to keep reconnecting to it
            Member member = allMembers.get(membershipEvent.getMember().getUuid());
            if (member == null) {
                return;
            }
            boolean isWKAMember = false;
            for (Member wkaMember : wkaMembers) {
                if (wkaMember.getHostName().equals(member.getHostName()) &&
                    wkaMember.getPort() == member.getPort()) {
                    log.info("WKA member " + member + " left cluster. Starting reconnection task...");
                    startWKAMemberReconnectionTask(member);
                    isWKAMember = true;
                    String memberStr = member.getHostName() + ":" + member.getPort();
                    nwConfig.getJoin().getTcpIpConfig().getMembers().remove(memberStr);
                    break;
                }
            }
            if (!isWKAMember) {
View Full Code Here


        if (hazelcastInstance == null) {
            hazelcastInstance = Hazelcast.newHazelcastInstance(config);
        }
        hazelcastInstance.getCluster().addMembershipListener(new GroupMembershipListener());
        localMemberUUID = hazelcastInstance.getCluster().getLocalMember().getUuid();
        Member localMember =
                MemberUtils.getLocalMember(domain, groupNwConfig.getPublicAddress(),
                                           groupMgtPort);
        log.info("Group management local member for domain [" + domain + "],sub-domain [" +
                 subDomain + "] UUID: " + localMemberUUID + ". " + localMember);
        MemberUtils.getMembersMap(hazelcastInstance, domain).put(localMemberUUID, localMember);
View Full Code Here

        @Override
        public void memberRemoved(MembershipEvent membershipEvent) {
            com.hazelcast.core.Member member = membershipEvent.getMember();
            log.info("Member left [" + member.getUuid() + "]: " + member.getInetSocketAddress().toString());
            Member removed = members.remove(membershipEvent.getMember().getUuid());
            connectedMembers.remove(removed);
        }
View Full Code Here

        @Override
        public void entryAdded(EntryEvent<String, Member> entryEvent) {
            if (entryEvent.getKey().equals(localMemberUUID)) { // Ignore local member
                return;
            }
            Member member = entryEvent.getValue();
            connectMember(member);
            MemberUtils.addMember(entryEvent.getValue(), tcpIpConfig);
        }
View Full Code Here

        org.apache.axis2.context.MessageContext axis2MsgCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext();

        String transport = axis2MsgCtx.getTransportIn().getName();
        algorithm.setApplicationMembers(activeMembers);
        Member currentMember = algorithm.getNextApplicationMember(algorithmContext);
        faultHandler.setCurrentMember(currentMember);

        if (currentMember != null) {

            // URL rewrite
            if (transport.equals("http") || transport.equals("https")) {
                String address = to.getAddress();
                if (address.indexOf(":") != -1) {
                    try {
                        address = new URL(address).getPath();
                    } catch (MalformedURLException e) {
                        String msg = "URL " + address + " is malformed";
                        log.error(msg, e);
                        throw new SynapseException(msg, e);
                    }
                }
                EndpointReference epr =
                        new EndpointReference(transport + "://" + currentMember.getHostName()
                                + ":" + ("http".equals(transport) ? currentMember.getHttpPort() :
                                currentMember.getHttpsPort()) + address);
                synCtx.setTo(epr);
                if (failover) {
                    synCtx.getEnvelope().build();
                }
View Full Code Here

        //if this is related to the already established session
        SessionInformation oldSession = (SessionInformation) synCtx.getProperty(
                SynapseConstants.PROP_SAL_CURRENT_SESSION_INFORMATION);

        List<Endpoint> endpoints = null;
        Member currentMember = null;

        if (oldSession == null) {

            if (log.isDebugEnabled()) {
                log.debug("Going to create a New session with id  " + sessionID);
View Full Code Here

    public Member getNextApplicationMember(AlgorithmContext algorithmContext) {
        if (members.size() == 0) {
            return null;
        }
        Member current = null;
        lock.lock();
        try {
            int currentMemberIndex = algorithmContext.getCurrentEndpointIndex();
            if (currentMemberIndex >= members.size()) {
                currentMemberIndex = 0;
View Full Code Here

        return lbMembershipHandler;
    }

    public void send(MessageContext synCtx) {
        SessionInformation sessionInformation = null;
        Member currentMember = null;
        setCookieHeader(synCtx);

        ConfigurationContext configCtx =
                ((Axis2MessageContext) synCtx).getAxis2MessageContext().getConfigurationContext();
        if (lbMembershipHandler.getConfigurationContext() == null) {
View Full Code Here

        List<Member> members = new ArrayList<Member>();
       
        for(Iterator memberIter = loadbalanceElement.getChildrenWithName(MEMBER);
            memberIter.hasNext();){
          OMElement memberEle = (OMElement) memberIter.next();
            Member member = new Member(memberEle.getAttributeValue(new QName("hostName")), -1);
            String http = memberEle.getAttributeValue(new QName("httpPort"));
            if (http != null) {
                member.setHttpPort(Integer.parseInt(http));
            }
            String https = memberEle.getAttributeValue(new QName("httpsPort"));
            if (https != null && https.trim().length() != 0) {
                member.setHttpsPort(Integer.parseInt(https.trim()));
            }
            members.add(member);
        }
        return members;
    }
View Full Code Here

                        */
                        StringBuffer url = new StringBuffer();
                        url.append(portData[1]);
                        url.append("://"+ hostName +":");
                        url.append(portData[0] + "/");
                        Member member = null;
                        /* here we put the Member in to a Map with the Instance ID as the Key */
                        if((member=addedEndpointList.get(portData[2]))==null){
                            member = new Member(hostName,-1);
                            addedEndpointList.put(portData[2],member);
                        }
                        if ("http".equals(portData[1])) {
                            member.setHttpPort(Integer.parseInt(portData[0]));

                        } else if("https".equals(portData[1])){
                            member.setHttpsPort(Integer.parseInt(portData[0]));
                        }
                        if(!"set".equals(System.getProperty("lb.disable"))){
                            log.info("Following Endpoint added to Load Balancing configuration: " + url.toString());
                        }
                        /* add the string we are reading from the file to addedEndPointList so that the endpoint will not
View Full Code Here

TOP

Related Classes of org.apache.axis2.clustering.Member

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.