Package com.sun.enterprise.config.serverbeans

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


        }
       
        try {
            ServerContext sc = ApplicationServer.getServerContext();       
            if (sc!=null)  {
                Config cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
                ModuleLogLevels allModulesLogLevels = cfg.getLogService().getModuleLogLevels( );
                ElementProperty[] elementProperties = allModulesLogLevels.getElementProperty( );
                if( elementProperties != null ) {
                    for( int i = 0; i < elementProperties.length; i++ ) {
                        String name = elementProperties[i].getName();
                        if( loggerName.startsWith(name)) {
View Full Code Here


        String configName = null;

        try {
            ConfigContext ctx = AdminService.getAdminService().
                        getAdminContext().getAdminConfigContext();
            Config config = ServerHelper.getConfigForServer(ctx,instName);

            if ( config != null )
                configName = config.getName();

        } catch (Exception ce) {
            _logger.log(Level.FINE,
                  "synchronization.config_not_found",instName);
        }
View Full Code Here

        try {
            if (_ctx == null ) {
                String msg = _localStrMgr.getString("ContextNotSet");
                throw new RuntimeException(msg);
            }
            Config config = ServerHelper.getConfigForServer(_ctx,serverName);
            if (config == null ) {
                String msg = _localStrMgr.getString("ConfigElementMissing",
                                serverName);
                throw new RuntimeException(msg);
            }
            return  config.getSecurityService().getAuthRealmByName(realmName).
                        getElementPropertyByName("file").getValue();
        } catch (ConfigException ce) {
            String msg = _localStrMgr.getString("GetLocationConfigErr");
            throw new RuntimeException(msg);
        }
View Full Code Here

    }
   
       
    // Method to get the reference to config
    public static Config getConfig(ConfigContext context) {
        Config mConfig=null;
        try {
            mConfig = ServerBeansFactory.getConfigBean(context);
        } catch(Exception e) {
        }
        return mConfig;
View Full Code Here

       
        if(choice.equals(StaticTest.ADD) || choice.equals(StaticTest.VALIDATE)) {
            final HttpListener h = (HttpListener)cce.getObject();
            String vsId = h.getDefaultVirtualServer();
            try {
                Config config = (Config) ((HttpService) cce.getClassObject()).parent();
                if( config!=null ) {
                    boolean exists = checkVSExists(vsId, config);
                    if(!exists) {
                        result.failed(smh.getLocalString(getClass().getName() + ".virtualserverNotFound",
                                                         "Attribute(default-virtual-server={0}) : Virtual Server not found", new Object[]{vsId}));
                    } else if (h.isEnabled()){
                            // When the listener is enabled then the virtual
                            // server must be on.
                        if (! isVirtualServerOn(h, config, result)){
                            result.failed(smh.getLocalString(getClass().getName() + ".cannotAddVsNotOn",
                                                             "Cannot add this HttpListener \"{0}\" because it is enabled but its virtual server \"{1}\" has a state other than \"on\" ({2})",
                                                             new Object[]{h.getId(), vsId, getDefaultVirtualServer(vsId, config).getState()}));
                        }
                    }
                }
               
            }
            catch(Exception e){
                _logger.log(Level.FINE, "domainxmlverifier.error", e);
               
            }
        } else if (choice.equals(StaticTest.UPDATE)) {
            if (cce.getName().equals("enabled") && ConfigBean.toBoolean((String) cce.getObject())){
                final HttpListener h = (HttpListener) cce.getClassObject();
                final Config c = (Config) ((HttpService) h.parent()).parent();
                final VirtualServer vs = getDefaultVirtualServer(h.getDefaultVirtualServer(), c);
                if (null != vs && !vs.getState().equals("on")){
                    result.failed(smh.getLocalString(getClass().getName() + ".cannotUpdateVSNotOn",
                                                     "Cannot enable this HttpListener \"{0}\" because its virtual server \"{1}\" has a state other than \"on\" ({2})",
                                                     new Object[]{h.getId(), vs.getId(), vs.getState()}));
View Full Code Here

      TargetType.CLUSTER, TargetType.SERVER, TargetType.DAS, TargetType.CONFIG};
        final Target target = TargetBuilder.INSTANCE.createTarget(
                vaildTargetTypes, targetName, getConfigContext());
        assert target != null;

        final Config config = target.getConfigs()[0];
        final JmsService jmsService = config.getJmsService();
        JmsHost host = jmsService.getJmsHostByName(jmsService.getDefaultJmsHost());
        if (host == null)
        {
            host = jmsService.getJmsHost(0);
        }
View Full Code Here

        if (ServerHelper.isClusterAdminSupported(acc)) {
            final String msg = localStrings.getString("domain.supports.cluster");
            throw new ConfigException(msg);
        }
        try {
            final Config defaultConfig = getTemplateConfig(profile);
            addConfig(acc, defaultConfig);
            addClusterSupportElements(acc);
            configurAdminServer(acc);
            createMissingFolders(acc, defaultConfig.getName());           
           
        } catch(final Exception e) {
            throw new ConfigException(e);
        }
    }
View Full Code Here

        final String tcn = SystemPropertyConstants.TEMPLATE_CONFIG_NAME;
        if (! exists(ConfigAPIHelper.getConfigsInDomain(tcc), tcn)) {
            final String msg = localStrings.getString("template.config.not.found", tcn, profileDomainXmlTemplate.getAbsolutePath());
            throw new IllegalArgumentException(msg);
        }
        final Config tc = ConfigAPIHelper.getConfigByName(tcc, tcn); // this has to exist
        return ( (Config)tc.clone() ); //cloning is required
    }
View Full Code Here

        domain.setNodeAgents(domain.newNodeAgents());
        domain.setLoadBalancers(domain.newLoadBalancers());
        domain.setLbConfigs(domain.newLbConfigs());
    }
    private static void configurAdminServer(final ConfigContext acc) throws ConfigException {
        final Config dasc   = ServerHelper.getConfigForServer(acc, SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME);
        final JavaConfig jc = dasc.getJavaConfig();
        jc.addJvmOptions("-Djavax.management.builder.initial=com.sun.enterprise.ee.admin.AppServerMBeanServerBuilder");
        jc.addJvmOptions("-Dcom.sun.appserv.pluggable.features=com.sun.enterprise.ee.server.pluggable.EEPluggableFeatureImpl");
        addClientHostNameProperty2SystemJmxConnector(dasc);
    }
View Full Code Here

          
                    // For an ADD operation the virtual server is being
                    // added to an http-service, which is the
                    // configcontextevents class object. Therefore the config is
                    // the parent of the class object:
                final Config config = (Config) ((HttpService) cce.getClassObject()).parent();
                validateAttribute(ServerTags.HTTP_LISTENERS,virtual.getHttpListeners(),config, result);
                //validateAttribute(ServerTags.HOSTS,virtual.getHosts(),config, result);
            } else if(cce.getChoice().equals("UPDATE")) {
                    // For an UPDATE operation the class object is the
                    // virtual server whose attributes are being
                    // updated. Therefore the config is the parent of the
                    // parent of this object:
                final VirtualServer vs = (VirtualServer) cce.getClassObject();
                final Config config = (Config) vs.parent().parent();
                String name = cce.getName();
                String value = (String) cce.getObject();
                validateAttribute(name,value,config, result);
                    // IF the state is being turned off then this can only
                    // occur if there's no http-listener which has this
View Full Code Here

TOP

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

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.