Examples of JavaConfig


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

    public List getRmicOptions() throws ConfigException {
       
        List rmicOptions = new ArrayList();

        // bean that represents the java configuration
        JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
                                    getConfigBeanByXPath(this.configContext,
                                        ServerXPathHelper.XPATH_JAVACONFIG);
        String options = jconfig.getRmicOptions();
        if (options == null) {
            options = jconfig.getDefaultRmicOptions();
        }
        StringTokenizer st = new StringTokenizer(options, " ");
        while (st.hasMoreTokens()) {
            String op = (String) st.nextToken();
            rmicOptions.add(op);
View Full Code Here

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

    public List getJavacOptions() throws ConfigException {
       
        List javacOptions = new ArrayList();

        // bean that represents the java configuration
        JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
                                    getConfigBeanByXPath(this.configContext,
                                        ServerXPathHelper.XPATH_JAVACONFIG);
        String options = jconfig.getJavacOptions();
        if (options == null) {
            options = jconfig.getDefaultJavacOptions();
        }
        StringTokenizer st = new StringTokenizer(options, " ");
        while (st.hasMoreTokens()) {
            String op = (String) st.nextToken();
            if ( !(op.startsWith("-d")
View Full Code Here

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

     * @throws    ConfigException    if an error while reading the server.xml
     */
    public boolean isEnvClasspathIgnored() throws ConfigException {

        // bean that represents the java configuration
        JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
                                    getConfigBeanByXPath(this.configContext,
                                       ServerXPathHelper.XPATH_JAVACONFIG);

        return jconfig.isEnvClasspathIgnored();
    }
View Full Code Here

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

        } catch(final Exception e) {
            // squelch, it's OK if we couldn't get the debug flag
            e.hashCode();   // silence FindBugs
        }
        if (debugMode) {
            final JavaConfig jc = ServerHelper.getConfigForServer(cc, sn).getJavaConfig();
            final String dopt = jc.getDebugOptions();
            msg = lsm.getString("start.debug.msg", dopt);
        }
        return ( msg );
    }
View Full Code Here

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

        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

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

    public Result validate(ConfigContextEvent cce) {
        Result result = super.validate(cce); // Before doing custom validation do basic validation
       
        if(cce.getChoice().equals(StaticTest.VALIDATE)) {
            StaticTest.setJavaHomeCheck(true);
            JavaConfig javaConfig = (JavaConfig) cce.getObject();
            if(javaConfig.getJavaHome().indexOf("${")<0)
               validateAttribute(ServerTags.JAVA_HOME, javaConfig.getJavaHome(), result);
            validateAttribute(ServerTags.DEBUG_OPTIONS, javaConfig.getDebugOptions(), result);
            validateAttribute(ServerTags.RMIC_OPTIONS, javaConfig.getRmicOptions(), result);
            validateAttribute(ServerTags.JAVAC_OPTIONS, javaConfig.getJavacOptions(), result);
           
            validateAttribute(ServerTags.CLASSPATH_PREFIX, javaConfig.getClasspathPrefix(), result);
            validateAttribute(ServerTags.CLASSPATH_SUFFIX, javaConfig.getClasspathSuffix(), result);
            validateAttribute(ServerTags.NATIVE_LIBRARY_PATH_PREFIX, javaConfig.getNativeLibraryPathPrefix(), result);
            validateAttribute(ServerTags.NATIVE_LIBRARY_PATH_SUFFIX, javaConfig.getNativeLibraryPathSuffix(), result);
            validateAttribute(ServerTags.BYTECODE_PREPROCESSORS, javaConfig.getBytecodePreprocessors(), result);
            JvmOptionsTest.validateJvmOptions(javaConfig.getJvmOptions(), result);
        }
       
        if(cce.getChoice().equals(StaticTest.UPDATE))  {
            validateAttribute(cce.getName(), (String) cce.getObject(), result);
        }
View Full Code Here

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

    }

    private static String getJavaHome(Server server, ConfigContext ctx)
        throws ConfigException
    {
        final JavaConfig javaConfig = getConfig(server, ctx).getJavaConfig();
        return javaConfig.getJavaHome();
    }
View Full Code Here

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

        // 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))
        {
            Cluster cluster = ClusterHelper.getClusterForInstance(configCtxt,
                    server.getName());
            addSystemProperties(cluster.getSystemProperty(), systemProperties);
        }
       
        //
        // add server system properties
        addSystemProperties(server.getSystemProperty(), systemProperties);
       
        //
        // add classpath
        // check to see if jvmCmd starts with same as processLauncher jvm.
        // if so, use the system property java-version to determine jvm version
        if(OS.isWindows())
        {
            // make sure all delimeters are the same
            jvmCmd=jvmCmd.replace('/', '\\');
        }
       
        if (jvmCmd.startsWith(System.getProperty(SystemPropertyConstants.JAVA_ROOT_PROPERTY)))
        {
            // jvm command are the same, so use processLauncher jvm version
            jvmCmd=null;
        }
        String classpath=deriveClasspath(plConfig, jvmCmd, javaConfig, profilerClasspath);
        getLogger().log(FINE_LEVEL, "Complete process classpath = " + classpath);
        command.setClasspath(classpath);
       
        //
        //add main class
        command.setMainClass(plConfig.getMainClass());
       
        //
        // native library path to java path and system properties
        deriveNativeClasspath(command, javaConfig, profiler, systemProperties);
       
        //
        // add all system properties to command as jvm args
        Iterator it=systemProperties.keySet().iterator();
        String key=null;
        String property=null, value=null;;
        while(it.hasNext())
        {
            key=(String)it.next();
            value=systemProperties.getProperty(key);
           
            // take care of vm arg that are sent in via the processlauncher.xml file
            if (key.startsWith("-"))
            {
                property = key;
                if (value != null && !value.equals(""))
                {
                    property += "=" + value;
                }
                command.addJvmOption(property);
                getLogger().log(FINE_LEVEL, "JVM Option: " + property);
            }
            else
            {
                // regular system property
                property = "-D" + key + "=" + value;
                command.addSystemVariable(key, value);
                getLogger().log(FINE_LEVEL, "System Property: " + property);
            }
        }
       
        //Add prefix and suffix for AS9Profile
        if (getProcessLauncherProfile().equals(AS9_INTERNAL_SERVER_PROFILE))
        {
            String classpathPrefix=javaConfig.getClasspathPrefix();

            // WBN Oct 2007 -- possibly add the uer's CP to suffix...
            String classpathSuffix=getClasspathSuffix(javaConfig);          

            String serverClasspath=javaConfig.getServerClasspath();
            getLogger().log(FINE_LEVEL, " prefix :: " + classpathPrefix
                    + " suffix :: " + classpathSuffix);
            if (classpathPrefix == null) classpathPrefix = "";
            command.addSystemVariable(CLASSPATH_PREFIX_PROPERTY, classpathPrefix);
            if (classpathSuffix == null) classpathSuffix = "";
View Full Code Here

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

    private final boolean isDebug()
    {
        boolean isDebug = false;
        try
        {
            JavaConfig jvmConfig = getJavaConfigBean();
            String value = jvmConfig.getAttributeValue(
                                ServerTags.DEBUG_ENABLED);
            if (value != null)
            {
                isDebug = Boolean.valueOf(value).booleanValue();
            }
View Full Code Here

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

    /**
     * Sets the debug-enabled attribute of the java-config element.
     */
    private final void setDebug(boolean debug) throws Exception
    {
        JavaConfig  jvmConfig   = getJavaConfigBean();
        String      value       = String.valueOf(debug);
        jvmConfig.setAttributeValue(ServerTags.DEBUG_ENABLED, value);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.