Package com.sun.enterprise.config.serverbeans

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


        //The clustered server inherits its configuration from the cluster
        server.setConfigRef(cluster.getConfigRef());

        //Now add the new server instance
        // to avoid Validator's complains
        Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
        domain.getServers().addServer(server, OVERWRITE);                       
       
        //Add the server to the cluster
        ServerRef serverRef = new ServerRef();
        serverRef.setRef(server.getName());
        cluster.addServerRef(serverRef, OVERWRITE);
View Full Code Here


       
        //Add system applications and resources
        addSystemApplications(server);
        addSystemResources(server);
        //Finally add the new server instance
        Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
        domain.getServers().addServer(server, OVERWRITE);                       
    }
View Full Code Here

            }
           
      ConfigAPIHelper.checkLegalName(serverName);
     
            // see if nodeagent exists, if not create an empty reference
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            NodeAgents agents=domain.getNodeAgents();
            NodeAgent agent=agents.getNodeAgentByName(nodeAgentName);
            if (agent == null) {
                // create an implnodeagent reference
                NodeAgentsConfigBean naMBean = getNodeAgentsConfigBean();
                naMBean.createNodeAgentConfig(nodeAgentName);
            }                   
           
            //a configuration and cluster cannot both be specified
            if (configName != null && clusterName != null) {
                throw new InstanceException(_strMgr.getString("configAndClusterMutuallyExclusive"));
            }           
           
            //Ensure that server specified by serverName does not already exist.
            //Given that we've already checked for uniqueness earlier, this should never
            //be the case, but we'll be extra safe here.
            Servers servers = domain.getServers();
            Server server = servers.getServerByName(serverName);
            if (server != null) {
                throw new InstanceException(_strMgr.getString("serverAlreadyExists",
                    serverName));
            }                           
View Full Code Here

                    "configurationSourceInvalid", sourceConfigName));
            }

            //Ensure that a configuration with the standalone configuration name
            //does not already exist.                       
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            Configs configs = domain.getConfigs();
            Config newConfig = configs.getConfigByName(newConfigName);
            if (newConfig != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationAlreadyExists", newConfigName));
            }

      //"domain" is a restricted name
            if ("domain".equals(newConfigName)) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameRestricted", newConfigName));
            }

      // Ensure that the name is a valid target meaning that there are no
      // servers and clusters with the same name                    
      Servers servers = domain.getServers();
      Server server = servers.getServerByName(newConfigName);
            if (server != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsServer", newConfigName));
            }

      Clusters clusters = domain.getClusters();
      Cluster cluster = clusters.getClusterByName(newConfigName);
            if (cluster != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsCluster", newConfigName));
            }

      NodeAgents nas = domain.getNodeAgents();
      NodeAgent na = nas.getNodeAgentByName(newConfigName);
            if (na != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsNodeAgent", newConfigName));
            }
View Full Code Here

            EEDomainsManager mgr = new EEDomainsManager();
            mgr.deleteConfigururation(new RepositoryConfig(),
                configName)
           
            //Remove the configuration
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            Configs configs = domain.getConfigs();
            configs.removeConfig(config, OVERWRITE);
        } catch (Exception ex) {
            throw getExceptionHandler().handleConfigException(
                ex, "eeadmin.deleteConfiguration.Exception", configName);           
        }
View Full Code Here

     */
    private boolean hasRendezvousOccurred() throws ConfigException, MBeanException
    {      
        final ConfigContext configContext =
            ApplicationServer.getServerContext().getConfigContext();
        final Domain domain = ServerBeansFactory.getDomainBean(configContext);
        final NodeAgents controllers = domain.getNodeAgents();
        final NodeAgent controller = controllers.getNodeAgentByName(getNodeAgentName());
       
        boolean rendezvousOccurred = true;
        ElementProperty rendezvousProperty = null;
       
View Full Code Here

     * because we assume there is always at least one configuration in the domain.
     */
    public static Config[] getConfigsInDomain(ConfigContext configContext)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext);         
        return domain.getConfigs().getConfig();
    }
View Full Code Here

     * Return true if the given configName is a configuration.
     */
    public static boolean isAConfig(ConfigContext configContext, String configName)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext);          
        final Config config = domain.getConfigs().getConfigByName(configName);
        return (config != null ? true : false);
    }
View Full Code Here

     * is thrown if the configuration does not exist.
     */
    public static Config getConfigByName(ConfigContext configContext, String configName)
        throws ConfigException
    {
        final Domain domain = getDomainConfigBean(configContext);       
        final Config config = domain.getConfigs().getConfigByName(configName);
        if (config == null) {
            throw new ConfigException(_strMgr.getString("noSuchConfig", configName));
        }
        return config;
    }
View Full Code Here

    protected ConvergedLbConfigs getConvergedLbConfigs() {
        try {
            ConfigContext ctx = AdminService.getAdminService().getAdminContext()
                                            .getAdminConfigContext();
            Domain domain = (Domain) ctx.getRootConfigBean();
            ConvergedLbConfigs clbConfigs = domain.getConvergedLbConfigs();

            if (clbConfigs == null) {
                _logger.log(Level.INFO, _strMgr.getString("ClbConfigsNull"));
                clbConfigs = new ConvergedLbConfigs();
                domain.setConvergedLbConfigs(clbConfigs);
            } else {
                _logger.log(Level.INFO, _strMgr.getString("ClbConfigsNotNull"));
            }

            return clbConfigs;
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.