Examples of JavaConfig


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("-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

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

        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

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

        classnameCombo.setSelectedItem(config.getPropertyAsString(JavaSampler.CLASSNAME));
    }

    /** {@inheritDoc} */
    public TestElement createTestElement() {
        JavaConfig config = new JavaConfig();
        modifyTestElement(config);
        return config;
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    }

    /* Implements JMeterGUIComponent.createTestElement() */
    public TestElement createTestElement()
    {
        JavaConfig config = new JavaConfig();
        modifyTestElement(config);
        return config;
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    /* Implements JMeterGuiComponent.modifyTestElement(TestElement) */
    public void modifyTestElement(TestElement sampler)
    {
        sampler.clear();
        JavaConfig config = (JavaConfig) javaPanel.createTestElement();
        configureTestElement(sampler);
        sampler.addTestElement(config);
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    }

    /* Implements JMeterGUIComponent.createTestElement() */
    public TestElement createTestElement()
    {
        JavaConfig config = new JavaConfig();
        modifyTestElement(config);
        return config;
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    this.add(mainPanel);
  }
 
  public TestElement createTestElement()
  {
    JavaConfig config = (JavaConfig)javaPanel.createTestElement();
    JavaSampler sampler = new JavaSampler();
    this.configureTestElement(sampler);
    sampler.addTestElement(config);
    return sampler;
  }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    classnameCombo.setSelectedItem(config.getPropertyAsString(JavaSampler.CLASSNAME));
  }
 
  public TestElement createTestElement()
  {
    JavaConfig config = new JavaConfig();
    this.configureTestElement(config);
    config.setArguments((Arguments)argsPanel.createTestElement());
    config.setClassname(classnameCombo.getSelectedItem().toString());
    return config;
  }   
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    /* Implements JMeterGuiComponent.modifyTestElement(TestElement) */
    @Override
    public void modifyTestElement(TestElement sampler) {
        sampler.clear();
        JavaConfig config = (JavaConfig) javaPanel.createTestElement();
        configureTestElement(sampler);
        sampler.addTestElement(config);
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.java.config.JavaConfig

    }

    /** {@inheritDoc} */
    @Override
    public TestElement createTestElement() {
        JavaConfig config = new JavaConfig();
        modifyTestElement(config);
        return config;
    }
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.