Package com.sun.enterprise.config.serverbeans

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


        }
    }

    private void enableCluster(String clusterName) 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(true);
    }
View Full Code Here


    private static void addDefaultCluster(final ConfigContext acc) throws ConfigException {

        final Domain domain = ConfigAPIHelper.getDomainConfigBean(acc);

        Clusters clusters = domain.getClusters();
        Cluster cl = new Cluster();
        cl.setName(DEFAULT_CLUSTER);
        cl.setConfigRef(DEFAULT_CLUSTER_CONFIG);
        cl.setHeartbeatEnabled(true);
        cl.setHeartbeatPort(Integer.toString((new Long(Math.round(Math.random()*45556))).intValue()));
        cl.setHeartbeatAddress("228.8.7.9");

        ResourceRef rref = new ResourceRef();
        rref.setEnabled(true);
        rref.setRef("jdbc/__CallFlowPool");

        ApplicationRef aref = new ApplicationRef();
        aref.setEnabled(true);
        aref.setDisableTimeoutInMinutes("30");
        aref.setLbEnabled(false);
        aref.setRef("SipContainerLifecycle");

        cl.addResourceRef(rref);
        cl.addApplicationRef(aref);

        clusters.addCluster(cl);
    }
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

        }
    }

    private void enableCluster(String clusterName) 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(true);
    }
View Full Code Here

        initialize(cluster, config, domain, theServer);
    }

    // this constructor is for use for pre-existing servers.
    ServerPorts(Domain domain, Server theServer) {
        Cluster cluster = null;
        Config config = null;

        if (theServer.isInstance())
            cluster = domain.getClusterForInstance(theServer.getName());
View Full Code Here

TOP

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

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.