Package com.sun.enterprise.config.serverbeans

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


    This operation returns true   if  Profiler connected to current HTTP Service.
    @throws ConfigException in case of failure.
     */
    public boolean isProfilerExist() throws ConfigException
    {
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        return  (javaConfig.getProfiler()!=null);
    }
View Full Code Here


     * Returns null if no profiler is registered.
     */
    public String getProfiler() throws ConfigException
    {
        String profilerName = null;
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        Profiler profiler = javaConfig.getProfiler();
        if (profiler != null)
        {
            profilerName = profiler.getName();
        }
        return profilerName;
View Full Code Here

    /**
    This operation returns list of JvmOptions  connected to this class.
     */
    public String[] getJvmOptions() throws ConfigException
    {
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        return javaConfig.getJvmOptions();
    }
View Full Code Here

    /**
    This operation returns list of JvmOptions  connected to this class.
     */
    public void setJvmOptions(String[] options) throws ConfigException
    {
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        javaConfig.setJvmOptions(options);
        getConfigContext().flush();
    }
View Full Code Here

        // 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("-D" + 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(Level.FINE, "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(Level.FINE, "JVM Option: " + property);
            } else {
                // regular system property
                property = "-D" + key + "=" + value;
                command.addSystemVariable(property);
                getLogger().log(Level.FINE, "System Property: " + property);
            }
        }

        //Add prefix and suffix for AS9Profile
        if (getProcessLauncherProfile().equals(AS9_INTERNAL_SERVER_PROFILE)) {
            String classpathPrefix=javaConfig.getClasspathPrefix();
            String classpathSuffix=javaConfig.getClasspathSuffix();
            String serverClasspath=javaConfig.getServerClasspath();
            getLogger().log(Level.FINE, " prefix :: " + classpathPrefix
                                          + " suffix :: " + classpathSuffix);
            if (classpathPrefix == null) classpathPrefix = "";
            command.addSystemVariable("-D" + CLASSPATH_PREFIX_PROPERTY + "=" + classpathPrefix);
            if (classpathSuffix == null) classpathSuffix = "";
View Full Code Here

        domain.setLoadBalancers(domain.newLoadBalancers());
        domain.setLbConfigs(domain.newLbConfigs());
    }
    private static void configureAdminServer(final ConfigContext acc) throws ConfigException {
        final Config dasc   = ServerHelper.getConfigForServer(acc, SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME);
        final JavaConfig jc = dasc.getJavaConfig();
        jc.removeJvmOptions("-Dcom.sun.appserv.pluggable.features=org.jvnet.glassfish.comms.server.pluggable.extensions.sip.SipPEPluggableFeatureImpl");
        jc.addJvmOptions("-Dcom.sun.appserv.pluggable.features=org.jvnet.glassfish.comms.server.pluggable.extensions.sip.SipEEPluggableFeatureImpl");
        addClientHostNameProperty2SystemJmxConnector(dasc);
    }
View Full Code Here

            return;
        }

        try {
            for (Config c : configs.getConfig()) {
                JavaConfig jc = c.getJavaConfig();
                if (jc == null) {
                    continue;
                }

                // fix issues where each new config gets 2x, 3x, 4x the data
                newJvmOptions.clear();
                oldJvmOptions = Collections.unmodifiableList(jc.getJvmOptions());
                doAdditions("server-config".equals(c.getName()));
                doRemovals();
                ConfigSupport.apply(new JavaConfigChanger(), jc);
            }
        }
View Full Code Here

        JmsHost jmsHost = getJmsHost();


        if (jmsHost != null) {//todo: && jmsHost.isEnabled()) {
            JavaConfig javaConfig = (JavaConfig) Globals.get(JavaConfig.class); ;
            String java_home = javaConfig.getJavaHome();

            //Get broker type from JMS Service.
            // String brokerType = jmsService.getType();
            /*
             * XXX: adjust the brokertype for the new DIRECT mode in 4.1
View Full Code Here

        JmsHost jmsHost = getJmsHost();


        if (jmsHost != null) {//todo: && jmsHost.isEnabled()) {
            JavaConfig javaConfig = (JavaConfig) Globals.get(JavaConfig.class); ;
            String java_home = javaConfig.getJavaHome();

            //Get broker type from JMS Service.
            // String brokerType = jmsService.getType();
            /*
             * XXX: adjust the brokertype for the new DIRECT mode in 4.1
View Full Code Here

            return;
        }

        try {
            for (Config c : configs.getConfig()) {
                JavaConfig jc = c.getJavaConfig();
                if (jc == null) {
                    continue;
                }

                // fix issues where each new config gets 2x, 3x, 4x the data
                newJvmOptions.clear();
                oldJvmOptions = Collections.unmodifiableList(jc.getJvmOptions());
                doAdditions("server-config".equals(c.getName()));
                doRemovals();
                ConfigSupport.apply(new JavaConfigChanger(), jc);
            }
        }
View Full Code Here

TOP

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

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.