Package com.sun.enterprise.config.serverbeans

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


        HashMap result = new HashMap();
       
        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                               .getAdminConfigContext();
            Domain domain = (Domain) ctx.getRootConfigBean();
            Configs configs = domain.getConfigs();

            // check if provided clbName is valid
            if (configs != null) {
                boolean found = false;
                Config[] configArray = configs.getConfig();
View Full Code Here


        configureDefaultJmsHost(dc);
        addClientHostNameProperty2SystemJmxConnector(dc);
    }

    private static void addClusterSupportElements(final ConfigContext acc) throws ConfigException {
        final Domain domain = ConfigAPIHelper.getDomainConfigBean(acc);
        domain.setClusters(domain.newClusters());
        domain.setNodeAgents(domain.newNodeAgents());
        domain.setLoadBalancers(domain.newLoadBalancers());
        domain.setLbConfigs(domain.newLbConfigs());
    }
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()));
 
View Full Code Here

        clusters.addCluster(cl);
    }

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

        final Domain domain = ConfigAPIHelper.getDomainConfigBean(acc);
        ConvergedLbConfigs clbConfigs = new ConvergedLbConfigs();
        domain.setConvergedLbConfigs(clbConfigs);

        ConvergedLbConfig clbConfig = new ConvergedLbConfig();
        clbConfig.setName("converged-lb-config-1");

        ConvergedLbPolicy clbPolicy = new ConvergedLbPolicy();
View Full Code Here

    }

    void checkConnectorModule() throws ConfigException {
        ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                            .getAdminConfigContext();
        Domain domain = (Domain) ctx.getRootConfigBean();
        if (domain.getApplications().getConnectorModuleByName("sundiameter") == null) {
            String msg = _strMgr.getString("ConnectorModuleNotDeployed");
            throw new ConfigException(msg);
        }
    }
View Full Code Here

        boolean matchFound = false;
       
        try {
            ConfigContext adminConfigContext =
                    AdminService.getAdminService().getAdminContext().getAdminConfigContext();
            Domain domain = (Domain) adminConfigContext.getRootConfigBean();
            ConvergedLbConfigs clbConfigs = domain.getConvergedLbConfigs();
            // Null in case of a DAS or developer profile instance.Hence no CLB
            // frontending  this cluster.
            if (clbConfigs == null) {
                return false;
            }
View Full Code Here

        if (addr != null && !addr.equals("0.0.0.0")) {
            return addr;
        }

        Dom serverDom = Dom.unwrap(server);
        Domain domain = serverDom.getHabitat().getService(Domain.class);
        Nodes nodes = serverDom.getHabitat().getService(Nodes.class);
        ServerEnvironment env =
                serverDom.getHabitat().getService(ServerEnvironment.class);

        if (server.isDas()) {
            if (env.isDas()) {
                // We are the DAS. Return our hostname
                return System.getProperty(
                        SystemPropertyConstants.HOST_NAME_PROPERTY);
            } else {
                return null;    // IT 12778 -- it is impossible to know
            }
        }

        String hostName = null;

        // Get it from the node associated with the server
        String nodeName = server.getNodeRef();
        if (StringUtils.ok(nodeName)) {
            Node node = nodes.getNode(nodeName);
            if (node != null) {
                hostName = node.getNodeHost();
            }
            // XXX Hack to get around the fact that the default localhost
            // node entry is malformed
            if (hostName == null && nodeName.equals("localhost-" + domain.getName())) {
                hostName = "localhost";
            }
        }

        if (StringUtils.ok(hostName)) {
View Full Code Here

            String portString = null;
            String addressString = null;

        try {
            Dom serverDom = Dom.unwrap(server);
            Domain domain = serverDom.getHabitat().getService(Domain.class);

            adminListenerRaw = GlassFishConfigBean.getRawView(adminListener);
            portString = adminListenerRaw.getPort();
            addressString = adminListenerRaw.getAddress();
            PropertyResolver resolver = new PropertyResolver(domain, server.getName());
View Full Code Here

                throw new AuthException("'loginErrorPage' "
                        + "must be supplied as a property in the provider-config "
                        + "in the domain.xml file!");
            }
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            Domain domain = habitat.getService(Domain.class);
            NetworkListener adminListener = domain.getServerNamed("server").getConfig().getNetworkConfig().getNetworkListener("admin-listener");

            if (restURL.contains(TOKEN_ADMIN_LISTENER_PORT)) {
                restURL = restURL.replace(TOKEN_ADMIN_LISTENER_PORT, adminListener.getPort());
            }
View Full Code Here

                @HandlerOutput(name="cluster", type=String.class)
            })
    public static void getClusterForConfig(HandlerContext handlerCtx) {
        String configName = (String)handlerCtx.getInputValue("configName");
        String clusterName = null;
        Domain domain = GuiUtil.getHabitat().getService(Domain.class);
       
        for (Cluster cluster: domain.getClusters().getCluster()) {
            if (cluster.getConfigRef().equals(configName)) {
                clusterName = cluster.getName();
                break;
            }
        }
View Full Code Here

TOP

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

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.