Package com.sun.enterprise.config.serverbeans

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


   
    public Result validate(ConfigContextEvent cce) {
        Result result = super.validate(cce); // Before doing custom validation do basic validation
       
        if(cce.getChoice().equals(StaticTest.VALIDATE)) {
            Profiler profiler = (Profiler) cce.getObject();
            validateAttribute(ServerTags.CLASSPATH, profiler.getClasspath(), result);
            JvmOptionsTest.validateJvmOptions(profiler.getJvmOptions(), result);
        }
       
        if(cce.getChoice().equals(StaticTest.UPDATE))  {
            validateAttribute(cce.getName(), (String) cce.getObject(), result);
        }
View Full Code Here


        // 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();
View Full Code Here

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

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

        // 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();
View Full Code Here

    This operation creates Profiler according to attributes and adds(links) it to current HTTP Service;
    If attribute is 'null' then default value will be set.
     */
    public void createProfiler(String name, String classpath, String nativeLibraryPath, Boolean enabled) throws ConfigException
    {
        Profiler element = new Profiler();
        if(name!=null)
            element.setName(name);
        if(classpath!=null)
            element.setClasspath(classpath);
        if(nativeLibraryPath!=null)
            element.setNativeLibraryPath(nativeLibraryPath);
        if(enabled!=null)
            element.setEnabled(enabled.booleanValue());
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        javaConfig.setProfiler(element);
       
        getConfigContext().flush();
    }
View Full Code Here

     */
    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

        try {
            ConfigSupport.apply(new SingleConfigCode<JavaConfig>() {

                public Object run(JavaConfig param) throws PropertyVetoException, TransactionFailure {
                    Profiler newProfiler = param.createChild(Profiler.class);
                    newProfiler.setName(name);
                    newProfiler.setClasspath(classpath);
                    newProfiler.setEnabled(enabled.toString());
                    newProfiler.setNativeLibraryPath(nativeLibraryPath);
                    if (properties != null) {
                        for ( Map.Entry e : properties.entrySet()) {
                            Property prop = newProfiler.createChild(Property.class);
                            prop.setName((String)e.getKey());
                            prop.setValue((String)e.getValue());
                            newProfiler.getProperty().add(prop);
                        }
                    }
                    param.setProfiler(newProfiler);                   
                    return newProfiler;
                }
View Full Code Here

        try {
            ConfigSupport.apply(new SingleConfigCode<JavaConfig>() {

                public Object run(JavaConfig param) throws PropertyVetoException, TransactionFailure {
                    Profiler newProfiler = param.createChild(Profiler.class);
                    newProfiler.setName(name);
                    newProfiler.setClasspath(classpath);
                    newProfiler.setEnabled(enabled.toString());
                    newProfiler.setNativeLibraryPath(nativeLibraryPath);
                    if (properties != null) {
                        for ( Map.Entry e : properties.entrySet()) {
                            Property prop = newProfiler.createChild(Property.class);
                            prop.setName((String)e.getKey());
                            prop.setValue((String)e.getValue());
                            newProfiler.getProperty().add(prop);
                        }
                    }
                    param.setProfiler(newProfiler);                   
                    return newProfiler;
                }
View Full Code Here

TOP

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

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.