Package com.sun.enterprise.ee.cms.core

Examples of com.sun.enterprise.ee.cms.core.GroupHandle


    public List<String> getHealthyInstances() {
        final int INITIAL_CAPACITY = 10;
        final int INCREMENTAL = 5;
        Vector healthyInstances = new Vector(INITIAL_CAPACITY,INCREMENTAL);
        final long startTime = System.currentTimeMillis();
        GroupHandle groupHandle = gmsEventListenerImpl.getGroupManagementService().getGroupHandle();
        List<String> coreMembers = groupHandle.getCurrentCoreMembers();
        for (String core : coreMembers) {
            //Changing such that threshold of 6 seconds and
            //timeout of 0 seconds is used. This will ensure value
            //is returned from maintained GMS state cache.
            //These values will later be used as default and this
            //change will be reverted back
            MemberStates state = groupHandle.getMemberState(core,
                    6000L, 0L);
            if (state == MemberStates.ALIVEANDREADY
                    || state == MemberStates.READY) {
                healthyInstances.add(core);
            } else if (state == MemberStates.UNKNOWN) {
                MemberStates pollState = groupHandle.getMemberState(core, 6000L, 3000L);
                if ( pollState == MemberStates.ALIVEANDREADY ||  pollState == MemberStates.READY) {
                    healthyInstances.add(core);
                } else {
                    long duration = System.currentTimeMillis() - startTime;
                    if (logger.isLoggable(Level.FINER)) {
                        logger.finer("DCU getHealthyInstances: getMemberState(" + core + ", 6 secs, 3 secs)  hb only state=" + state +
                                    " poll state=" +  pollState + " getHealthyInstances current duration(in ms)=" + duration);
                    }
                }
            }
        }

        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "clb.gms_module_core_members", new Object[] {
                    clusterName, groupHandle.getAllCurrentMembers().toString()
                });
            logger.log(Level.FINE, "clb.gms_module_core_current_members", new Object[] {
                    clusterName, coreMembers.toString()
                });
            logger.log(Level.FINE, "clb.gms_module_current_healthy_members", new Object[] {
View Full Code Here


    public List<String> getHealthyInstances() {
        final int INITIAL_CAPACITY = 10;
        final int INCREMENTAL = 5;
        Vector healthyInstances = new Vector(INITIAL_CAPACITY,INCREMENTAL);
        GroupHandle groupHandle = gmsEventListenerImpl.
            getGroupManagementService().getGroupHandle();
        final long startTime = System.currentTimeMillis();
        List<String> coreMembers = groupHandle.getCurrentCoreMembers();
        for (String core : coreMembers) {
            //Changing such that threshold of 6 seconds and
            //timeout of 0 seconds is used. This will ensure value
            //is returned from maintained GMS state cache.
            //These values will later be used as default and this
            //change will be reverted back
            MemberStates state = groupHandle.getMemberState(core,
                    6000L, 0L);
            if (state == MemberStates.ALIVEANDREADY
                    || state == MemberStates.READY) {
                healthyInstances.add(core);
            } else if (state == MemberStates.UNKNOWN) {
                MemberStates pollState = groupHandle.getMemberState(core, 6000L, 3000L);
                if ( pollState == MemberStates.ALIVEANDREADY ||  pollState == MemberStates.READY) {
                    healthyInstances.add(core);
                } else {
                    long duration = System.currentTimeMillis() - startTime;
                    if (_logger.isLoggable(Level.FINER)) {
                        _logger.finer("CLB getHealthyInstances: getMemberState(" + core + ", 6 secs, 3 secs)  hb only state=" + state +
                                    " poll state=" +  pollState + " getHealthyInstances current duration(in ms)=" + duration);
                    }
                }
            }
        }
        if(_logger.isLoggable(Level.FINE)){
            _logger.log(Level.FINE,
                    "clb.gms_module_core_members",
                    new Object[]{clusterName, groupHandle.getAllCurrentMembers().toString()});
            _logger.log(Level.FINE,
                    "clb.gms_module_core_current_members",
                    new Object[]{clusterName, coreMembers.toString()});
            _logger.log(Level.FINE,
                    "clb.gms_module_current_healthy_members",
View Full Code Here

                                    String clusterName = NodeAgentMain.getClusterName(pInstance.getName());
                                    if (clusterName != null || !clusterName.equals("")) {
                                        HashMap gmsMap = NodeAgentMain.getGMSHandleMap();
                                        GroupManagementService gms = (GroupManagementService) gmsMap.get(clusterName);
                                        if (gms != null) {
                                            GroupHandle gh = gms.getGroupHandle();
                                            try {
                                                getLogger().log(Level.INFO, "GMS WATCHDOG notification to group:"+ clusterName + " that member:" +
                                                            pInstance.getName() + " has failed.");
                                                gh.announceWatchdogObservedFailure(pInstance.getName());
                                            } catch (Error e) {
                                                getLogger().log(Level.FINE, "Exception is ", e);
                                            }
                                        }
                                    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.cms.core.GroupHandle

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.