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

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


                try {
                    Cluster[] clusters = (Cluster[]) ClusterHelper.getClustersInDomain(context);
                    for (int i = 0; i < clusters.length; i++) {
                        String clusterName = clusters[i].getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
            } else {
                try {
                    if( currentServer != null) {
                        String clusterName = ((Cluster)(ClusterHelper.getClusterForInstance(context,currentServer))).getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
View Full Code Here


                try {
                    Cluster[] clusters = (Cluster[]) ClusterHelper.getClustersInDomain(context);
                    for (int i = 0; i < clusters.length; i++) {
                        String clusterName = clusters[i].getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
            } else {
               try {
                    if( currentServer != null) {
                        String clusterName = ((Cluster)(ClusterHelper.getClusterForInstance(context,currentServer))).getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
View Full Code Here

                try {
                    Cluster[] clusters = (Cluster[]) ClusterHelper.getClustersInDomain(context);
                    for (int i = 0; i < clusters.length; i++) {
                        String clusterName = clusters[i].getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
            } else {
                try {
                    if(currentServer != null) {
                       String clusterName = ((Cluster)(ClusterHelper.getClusterForInstance(context,currentServer))).getName();
                        if(clusterName != null) {
                            GroupManagementService gms = GMSFactory.getGMSModule(clusterName);
                            gms.addActionFactory(_instance);
                        }
                    }
                } catch (ConfigException ex) {
                } catch (GMSException ex) {
                }
View Full Code Here

    // get the configured iiop-listener address.
    private String getHostIP() {
        String hostAddress = null;
        try {
            GroupManagementService gms =
                    GMSFactory.getGMSModule(ReplicationUtil.getClusterName());
            Map memberDetails =
                    gms.getMemberDetails(ReplicationUtil.getInstanceName());
            List<IiopInfo> iiopInfos =
                    (List<IiopInfo>) memberDetails.get(IiopInfo.IIOP_MEMBER_DETAILS_KEY);
            if (iiopInfos != null && !iiopInfos.isEmpty()) {
                hostAddress = iiopInfos.get(0).getAddress();
            }
View Full Code Here

    }

    private DistributedStateCache getDSC() {
        DistributedStateCache cache = null;
        try {
            GroupManagementService gms =
                    GMSFactory.getGMSModule(ReplicationUtil.getClusterName());
            cache = gms.getGroupHandle().getDistributedStateCache();
        } catch (Exception ex) {
            logger.log(Level.SEVERE, ex.getMessage(), ex);
        }
        return cache;
    }
View Full Code Here

    }

    void leaveGMSGroupForNamedCluster( final String clusterName,
                              final GMSConstants. shutdownType shutdownType )
    {
        final GroupManagementService gms;
        try {
            gms = GMSFactory.getGMSModule(clusterName);
            if(gms != null){
                gms.shutdown(shutdownType);
                GMSFactory.setGMSEnabledState( clusterName,  Boolean.FALSE);
                GMSFactory.removeGMSModule( clusterName );
            }
            //gmsInstances.remove( clusterName );
        }
View Full Code Here

                }
              String initialHostList = ClusterHelper.getClusterPropertyValue(cluster, INITIAL_HOST_LIST);
              if (initialHostList != null)
                     props.put(ServiceProviderConfigurationKeys.VIRTUAL_MULTICAST_URI_LIST.toString(), initialHostList);
                GMSFactory.setGMSEnabledState(clusterName, Boolean.TRUE);
                GroupManagementService gms = (GroupManagementService) GMSFactory.startGMSModule(NODE_AGENT, clusterName, MemberType.WATCHDOG, props);
                gms.join();
                gmsMap.put(clusterName, gms);
            }
        } catch (Exception e) {
            getLogger().log(Level.INFO, "Exception while joining ", e);
View Full Code Here

                        getLogger().log(Level.INFO,
                           _strMgr.getString( "gms.initializing", clusterName));
                        GMSFactory.setGMSEnabledState( clusterName, Boolean.TRUE );
                        final Properties props  = getGMSConfigProps(cluster,
                                                              configContext);
                        final GroupManagementService gms =
                                (GroupManagementService) GMSFactory.startGMSModule(
                                    dasInstanceName,
                                    clusterName,
                                    //DAS is always a SPECTATOR member
                                    GroupManagementService.MemberType.SPECTATOR,
                                    props );
                        gms.addActionFactory(
                                new FailureNotificationActionFactoryImpl(this));
                        gms.addActionFactory(
                                new JoinNotificationActionFactoryImpl(this));
                        gms.addActionFactory(
                                new PlannedShutdownActionFactoryImpl(this));
                        gms.addActionFactory(
                                new FailureSuspectedActionFactoryImpl(this));

                        final String threadName ="GroupManagementService_"+
                                                dasInstanceName+'_'+clusterName;
                        gms.join();
                        initHealthMap(
                                    gms.getGroupHandle()
                                        .getCurrentCoreMembersWithStartTimes(),
                                      clusterName, cluster );
                    }
                }
            } catch (ConfigException ex) {
View Full Code Here

                                if (status.isStopped()) {
                                    // set for observer to check status and to setChanged flag so notification will be sent
                                    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) {
View Full Code Here

    private void announceShutdownState (final String clusterName,
                            final GMSConstants.shutdownState shutdownState) {

        if(GMSFactory.isGMSEnabled( clusterName )) {
            try {
                final GroupManagementService gms =
                                GMSFactory.getGMSModule( clusterName );
                gms.announceGroupShutdown( clusterName, shutdownState);
            }
            catch ( Exception e ) {
                //harmless at this point, hence ignored.
            }
        }
View Full Code Here

TOP

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

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.