Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Cluster


        if ( timeout < 0 ) {
            String msg = _strMgr.getString("InvalidNumber");
            throw new MBeanException ( new ConfigException(msg));
        }

        Cluster c = null;
        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                    .getAdminConfigContext();
            c = ClusterHelper.getClusterByName(ctx, clusterName);
        } catch (ConfigException ce) {
            throw new MBeanException(ce);
        }
        if (c == null ) {
            String msg = _strMgr.getString("ClusterNotDefined", clusterName);
            throw new MBeanException ( new ConfigException(msg));
        }
        ApplicationRef appRef = c.getApplicationRefByRef(appName);
        if (appRef == null ) {
            String msg = _strMgr.getString("AppRefNotDefined",
                                            appName, clusterName);
            throw new MBeanException (new ConfigException(msg));
        }
View Full Code Here


    {         
        _logger.log(Level.FINE,
            "[LBAdminMBean] disableApplication called for target "
            + clusterName + " app name is " + appName );

        Cluster c = null;
        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                    .getAdminConfigContext();
            c = ClusterHelper.getClusterByName(ctx, clusterName);
        } catch (ConfigException ce) {
            throw new MBeanException(ce);
        }
        if (c == null ) {
            String msg = _strMgr.getString("ClusterNotDefined", clusterName);
            throw new MBeanException ( new ConfigException(msg));
        }
        ApplicationRef appRef = c.getApplicationRefByRef(appName);
        if (appRef == null ) {
            String msg =
                _strMgr.getString("AppRefNotDefined", appName, clusterName);
            throw new MBeanException ( new ConfigException(msg));
        }
View Full Code Here

                if (!ClusterHelper.isACluster(ctx, target)) {
                    String msg = _strMgr.getString("NotCluster", target);
                    throw new MBeanException( new ConfigException(msg));
                }
            }
            Cluster c = null;
            Server s = null;
            if (ClusterHelper.isACluster(ctx, target)) {
                c = ClusterHelper.getClusterByName(ctx, target);
                if (c == null ) {
                    String msg = _strMgr.getString("ClusterNotDefined", target);
                    throw new MBeanException( new ConfigException(msg));
                }
            }else{
                s = ServerHelper.getServerByName(ctx, target);
                if (s == null ) {
                    String msg = _strMgr.getString("ServerNotDefined", target);
                    throw new MBeanException( new ConfigException(msg));
                }
            }
            createLBRef(target,configName);
            if(hcURL != null ){
                try{
                    createHealthChecker(hcURL, hcInterval, hcTimeout, configName, target);
                }catch(MBeanException e){
                    String msg = _strMgr.getString("HealthCheckerExists",target);
                    _logger.log(Level.WARNING, msg);
                }
            }
            if(enableInstances) {
                enableServer(target);
            }
            if(enableApps || lbPolicy != null || lbPolicyModule != null ) {
                ApplicationRef[] appRefs = null;
                LbConfig lbConfig = getLbConfig(configName);
                if (ClusterHelper.isACluster(ctx, target)) {
                    appRefs = c.getApplicationRef();
                   
                }else{
                    appRefs = s.getApplicationRef();
                }
                if (appRefs != null && enableApps ) {
View Full Code Here

    public InstanceReader[] getInstances() throws LbReaderException {
        ServerRef[] sRefs = null;

        try {
            Cluster c = ClusterHelper.getClusterByName(_configCtx,
                    _clusterRef.getRef());
            sRefs = c.getServerRef();
        } catch (ConfigException ce) {
            String msg = _strMgr.getString("ErrorFindingClusteredServers",
                    _clusterRef.getRef());
            throw new IllegalArgumentException(msg);
        }
View Full Code Here

  {
    //Set LbEnabled flag for Cluster Instances
    for (int ref=0; ref < clbRef.length; ref++) {
        String clusterName = clbRef[ref].getRef();
        if (clusterName != null ) {
           Cluster cluster = clusters.getClusterByName(clusterName);
           ServerRef[] serverRefs = cluster.getServerRef();
           for (int i=0; i < serverRefs.length; i++) {
         if (!serverRefs[i].isLbEnabled())
            serverRefs[i].setLbEnabled(true);
           }
        }
View Full Code Here

            ApplicationRef[] appRefs = null;
            ConvergedLbConfig clbConfig = getConvergedLbConfig(clbConfigName);

            if (ClusterHelper.isACluster(ctx, target)) {
                Cluster c = ClusterHelper.getClusterByName(ctx, target);

                if (c == null) {
                    String msg = _strMgr.getString("ClusterNotDefined", target);
                    throw new MBeanException(new ConfigException(msg));
                }

                appRefs = c.getApplicationRef();

                ServerRef[] sRefs = c.getServerRef();

                for (int i = 0; i < sRefs.length; i++)
                    sRefs[i].setLbEnabled(lbEnableInstances);
            } else {
                Server s = ServerHelper.getServerByName(ctx, target);
View Full Code Here

        if (clbcRef == null) {
            String msg = _strMgr.getString("ClusterNotDefinedInClbConfig", clusterName);
            throw new MBeanException(new ConfigException(msg));
        }

        Cluster c = null;

        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                            .getAdminConfigContext();
            c = ClusterHelper.getClusterByName(ctx, clusterName);
        } catch (ConfigException ce) {
            throw new MBeanException(ce);
        }

        if (c == null) {
            String msg = _strMgr.getString("ClusterNotDefined", clusterName);
            throw new MBeanException(new ConfigException(msg));
        }

        ServerRef[] sRefs = c.getServerRef();

        for (int i = 0; i < sRefs.length; i++) {
            if (sRefs[i].isLbEnabled() && (!force)) {
                String msg = _strMgr.getString("ServerNeedsToBeDisabled",
                        clusterName);
View Full Code Here

                // disable server
                boolean found = false;
                Domain domain = (Domain) ctx.getRootConfigBean();
                Cluster[] clusters = domain.getClusters().getCluster();
                for (int i=0; i < clusters.length; i++) {
                    Cluster cluster = clusters[i];
                    ServerRef[] sRefs = cluster.getServerRef();
                    for (int j=0; j < sRefs.length; j++) {
                        if (sRefs[j].getRef().equals(target)) {
                            sRefs[j].setLbEnabled(false);
                            sRefs[j].setDisableTimeoutInMinutes(time);
                            found = true;
View Full Code Here

        }
    }

    private void disableCluster(String clusterName, String time) throws MBeanException {         

        Cluster c = null;
        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                    .getAdminConfigContext();
            c = ClusterHelper.getClusterByName(ctx, clusterName);
        } catch(ConfigException ce) {
            throw new MBeanException(ce);
        }
       
        ServerRef[] sRefs = c.getServerRef();
        for (int i=0; i < sRefs.length; i++) {
            sRefs[i].setLbEnabled(false);
            sRefs[i].setDisableTimeoutInMinutes(time);
        }
    }
View Full Code Here

                // enable server
                boolean found = false;
                Domain domain = (Domain) ctx.getRootConfigBean();
                Cluster[] clusters = domain.getClusters().getCluster();
                for (int i=0; i < clusters.length; i++) {
                    Cluster cluster = clusters[i];
                    ServerRef[] sRefs = cluster.getServerRef();
                    for (int j=0; j < sRefs.length; j++) {
                        if (sRefs[j].getRef().equals(target)) {
                            sRefs[j].setLbEnabled(true);
                            found = true;
                            break;
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Cluster

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.