Package com.sun.enterprise.config.serverbeans

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


    private void checkWebModuleReferences(String webModuleName)
    throws ConfigException {
        ArrayList virtualServerIds = new ArrayList();
       
        //ms1  Server rootElement = ServerBeansFactory.getServerBean(context);
        Config config  = (Config) ConfigBeansFactory.getConfigBeanByXPath(getConfigContext(),ServerXPathHelper.XPATH_CONFIG);
        HttpService httpService = config.getHttpService();
        VirtualServer[] virtualServers = httpService.getVirtualServer();
        for (int j = 0; j < virtualServers.length; j++) {
            VirtualServer aServer   = virtualServers[j];
            String defWebModule     = aServer.getDefaultWebModule();
            if ((defWebModule != null) &&
View Full Code Here


        final Target target = getTarget(targetName);       
        check1ToN(target);
        ObjectName targetON = getSslTargetObjectName(target, id, type);
        if ("iiop-service".equals(type))
        {
            Config config = getConfigBeanForTarget(target);
            IiopService iiopService = config.getIiopService();
            SslClientConfig sslCfg = new SslClientConfig();
            sslCfg.setXPath(sslCfg.getAbsoluteXPath(iiopService.getXPath()));
            ManagedConfigBean mb = new ManagedConfigBean(
                    (ConfigBean)sslCfg, m_registry, getDomainName());
            mb.createChildByType("ssl", al, null, true);
View Full Code Here

    {
        final Target target = getTarget(targetName);
        check1ToN(target);
       
        //first, create standalone auth-realm
        Config config = getConfigBeanForTarget(target);
        SecurityService secService = config.getSecurityService();
        ManagedConfigBean mcbSecService = getManagedConfigBean(secService);
        AuthRealm authRealm = (AuthRealm)mcbSecService.createChildByType(
                ServerTags.AUTH_REALM, attrs, props);
       
        // Second, check keyfile
View Full Code Here

    {
        final Target target = getTarget(targetName);
        check1ToN(target);
        final ConfigTarget configTarget = target.getConfigTarget();
        boolean bMessageConfigJustCreated = false;
        Config config = ConfigAPIHelper.getConfigByName(getConfigContext(), configTarget.getName());
        SecurityService securityService = config.getSecurityService();
       
        //message-security-config
        MessageSecurityConfig messageSecurity = securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
        if(messageSecurity==null)
        {
View Full Code Here

        String  targetName    // target name (config, instance, cluster, or 'server')
        ) throws Exception
    {
        final Target target = getTarget(targetName);
        check1ToN(target);
        Config config = ConfigAPIHelper.getConfigByName(getConfigContext(),
                        target.getConfigTarget().getName());
        SecurityService securityService = config.getSecurityService();
        MessageSecurityConfig messageSecurity =
            securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
        if(messageSecurity==null)
        {
            String msg = localStrings.getString( "admin.mbeans.configs.message_security_config_not_found",
View Full Code Here

        String  messageLayer,     // auth-layer attribute of message-security-config
        String  targetName    // target name (config, instance, cluster, or 'server')
        ) throws Exception
    {
        final Target target = getListTarget(targetName);
        Config config = ConfigAPIHelper.getConfigByName(getConfigContext(),
                        target.getConfigTarget().getName());
        SecurityService securityService = config.getSecurityService();
        if(securityService==null)
            return null;
        if(messageLayer!=null)
        {
            MessageSecurityConfig messageSecurity =
View Full Code Here

        //command.addJvmOption("-XX:+LogVMOutput");
        //command.addJvmOption("-XX:LogFile=" + logFile);
        //command.addJvmOption("-XX:LogFile=/tmp/threadDump.txt");
       
        // get server's config
        Config config=ServerHelper.getConfigForServer(configCtxt, serverName);
       
        // configure log service and print redirect message
        String logFile=configureLogService(config);
        if (bDebug) System.out.println("LOGFILE = " + logFile);
       
        // make sure log is writable, if not a message will be logged to the screen if in verbose mode
        createFileStructure(logFile);
        command.setLogFile(logFile);
       
        // should NOT need to addLogFileToLogger(logFile), logManager should already do this for us
        // may need to enable if log is movable ???
       
        // TODO Logging Weirdnesses
        addLogFileToLogger(logFile);
       
        // add log to properties so PEMAIN will redirect is applicable
        command.addSystemVariable(LOGFILE_SYSTEM_PROPERTY, logFile);
       
        getLogger().log(FINE_LEVEL,"Retrieved domain.xml from " + domainXMLLocation);
        getLogger().log(FINE_LEVEL,"Start building the command the to execute.");
       
        //Set system properties that correspond directly to asenv.conf/bat. This
        //keeps us from having to pass them all from -D on the command line.
        //ASenvPropertyReader reader = new ASenvPropertyReader(System.getProperty(SystemPropertyConstants.CONFIG_ROOT_PROPERTY));
        //reader.setSystemProperties();
       
        // verbose set, flag used in ServerLogManager to send logs to stderr
        if (isVerboseEnabled())
        {
            command.addSystemVariable(VERBOSE_SYSTEM_PROPERTY, "true");
            // add to System.properties for config conditional adds (could be set about if not native launcher)
            System.setProperty(VERBOSE_SYSTEM_PROPERTY, "true");
        }
       
        // read in ASLauncherConfig
        String launcherConfigFile=System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)
        + File.separator + "lib" + File.separator + "processLauncher.xml";
       
        String processName=System.getProperty(LaunchConstants.PROCESS_NAME_PROP, INTERNAL_SERVER_PROFILE);
        getLogger().log(FINE_LEVEL,"Loading ASLauncher config from: " + launcherConfigFile
                + " - for the process named: " + processName);
       
        ASLauncherConfig plConfig=new ASLauncherConfig(launcherConfigFile, processName);
       
        // take plConfig properties as the base for the system jvm args for the new process
        Properties systemProperties=plConfig.getSystemProperties();
       
        // add domain.xml property elements to the jvm args in reverse order of precedence.
        // First add the domain properties
        addSystemProperties(domain.getSystemProperty(), systemProperties);
       
       
       
        // set config name (which is retrieved from domain.xml) into System properties to be used for path resolution
        System.setProperty(SystemPropertyConstants.CONFIG_NAME_PROPERTY, configRef);
        systemProperties.put(SystemPropertyConstants.CONFIG_NAME_PROPERTY, configRef);
       
        // get javaconfig for server that is being started
        JavaConfig javaConfig=config.getJavaConfig();
       
        // derive and add java command to Command
        String jvmCmd=javaConfig.getJavaHome() + File.separator + "bin"
                + File.separator + "java";
       
        command.setJavaCommand(jvmCmd);
       
       
        // fix for bug# 6323645
        // Do not add options which are not applicable for stop action.
        // For ex. debug options and profiler options.
        // In other words add the following options ony when the action
        // is other than stop.
       
        Profiler profiler=javaConfig.getProfiler();
        String profilerClasspath=null;
       
        if (!action.equals(LAUNCHER_STOP_ACTION))
        {
           
            // The debug options including the debug port would be added
            // to the command  when the action is start.
            // If the action is stop adding the same port to the java command
            // would stack up the ports and block until the port assigned for
            // start action is released. To avoid this we check for stop action.
           
            // If the stop action needs to be debugged then one work around is to
            // copy the java command from server.log, change the debug settings and
            // run the command.
           
            // debug options
            if ((javaConfig.isDebugEnabled() || isDebugEnabled()))
            {
                // add debug statements
                addDebugOptions(command, javaConfig.getDebugOptions());
            }
           
            // add profiler properties & jvm args
            if (profiler != null && profiler.isEnabled())
            {
                // add config properties
                addElementProperties(profiler.getElementProperty(), systemProperties);
                String [] jvmOptions=profiler.getJvmOptions();
                addJvmOptions(command, jvmOptions, action);
                profilerClasspath=profiler.getClasspath();
            }
        }
       
        // set the default locale specified in domain.xml config file
        String locale=domain.getLocale();
        if (locale == null || locale.equals(""))
        {
            // if not specified in domain try system
            locale=System.getProperty(SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY);
        }
        // make sure locale is specified before setting it
        if (locale != null && !locale.equals(""))
        {
            command.addSystemVariable(SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY, locale);
        }
        //
        // add jvm args, look for combined jvm options
        String[] jvmOptions=javaConfig.getJvmOptions();
        addJvmOptions(command, jvmOptions, action);
       
        //
        // add config system properties
        addSystemProperties(config.getSystemProperty(), systemProperties);
       
        //
        // add cluster system properties if the server instance is clustered
        if (ServerHelper.isServerClustered(configCtxt, server))
        {
View Full Code Here

                _logger.log(Level.FINE,
                        "clb.caught_an_exception",
                        ex);
        }

        Config instanceConfig = null;

        try {
            instanceConfig = ServerBeansFactory.getConfigBean(instanceConfigContext);
        } catch (ConfigException ex) {
            _logger.log(Level.SEVERE,
                    "clb.configexception_will_getting_instance_config",
                    ex.getMessage());
            if(_logger.isLoggable(Level.FINE))
                _logger.log(Level.FINE,
                        "clb.caught_an_exception",
                        ex);
            return;
        }

        AvailabilityService haService = instanceConfig.getAvailabilityService();

        if (haService == null) {
            _logger.log(Level.SEVERE,
                        "clb.no_availability_service_found");
            return;
        }

        ConvergedLoadBalancer clb = haService.getConvergedLoadBalancer();

        if (clb == null) {
            _logger.log(Level.INFO,
                    "clb.no_clb_entry_found");
            return;
        }

        _logger.log(Level.INFO,
                    "clb.clb_entry_found");
       
        //Setting config-name and  clb-config-file-name
        configName = instanceConfig.getName();
        clbConfigFileName = clb.getConfigFile();

        //Creating instance of HttpLoadBalancingManager
        //and SipLoadBalancerManager
        //They will be initialized later
View Full Code Here

   
    // Get the log level from domain.xml
    public String getLogLevel(String loggerName) {
        try {
            ServerContext sc = ApplicationServer.getServerContext();
            Config cfg = ServerBeansFactory.getConfigBean(sc.getConfigContext());
            ElementProperty[] elementProperties =
                cfg.getLogService().getModuleLogLevels().getElementProperty();
            for( int i = 0; i < elementProperties.length; i++ ) {
                String level = elementProperties[i].getValue();
                String prop = getPropertyName(loggerName);
                if (prop.equals(elementProperties[i].getName()))
                    return level;
View Full Code Here

    }

    private void initialize(){
        ServerContext sc = com.sun.enterprise.server.ondemand.OnDemandServer.getServerContext();
        ConfigContext instanceConfigContext = sc.getConfigContext();
        Config instanceConfig = null;
        com.sun.enterprise.config.serverbeans.Proxy proxy  = null;
        try {
            instanceConfig = ServerBeansFactory.getConfigBean(instanceConfigContext);
            if (instanceConfig.getAvailabilityService().
                    getConvergedLoadBalancer() != null) {
                proxy = instanceConfig.getAvailabilityService().
                        getConvergedLoadBalancer().getProxy();
            }           
        } catch (Exception ex) {
            _logger.log(Level.WARNING,"clb.proxy.config_default");
            return;
        }
        if (proxy == null) {
            _logger.log(Level.WARNING,"clb.proxy.config_default");
            return;
        }
        httpRequestPoolSize = Integer.parseInt(proxy.getRequestPoolSize());
        readtimeout = Integer.parseInt(proxy.getReadTimeoutInMillis());
        maxsendretries = Integer.parseInt(proxy.getSendRetryCount());
        String maxretries = System.getProperty(RECEIVE_RETRY_ATTEMPTS);       
        if ((maxretries != null) && (!maxretries.trim().equals(""))){
            try {
                maxreceiveretries = Integer.parseInt(maxretries);
            } catch (NumberFormatException numberFormatException) {
                maxreceiveretries = LoadBalancerProxyConstants.RECEIVE_ATTEMPTS;
            }
        }
        // keep alive from http-service
       
        try {
            instanceConfig =
                    ServerBeansFactory.getConfigBean(instanceConfigContext);
            if (instanceConfig.getHttpService().getKeepAlive() != null) {
                KeepAlive keepAlive =
                        instanceConfig.getHttpService().getKeepAlive();
                keepAliveConnections =
                        Long.parseLong(keepAlive.getMaxConnections());
                keepAliveIdleTime =
                        Integer.parseInt(keepAlive.getTimeoutInSeconds());
            }
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.