FileDocCategorySizeDatePackage
ManagedJVM.javaAPI DocGlassfish v2 API8246Fri May 04 22:33:56 BST 2007com.sun.enterprise.admin.server.core.mbean.config

ManagedJVM

public class ManagedJVM extends ConfigMBeanBase implements ConfigAttributeName.JavaConfig
Represents the manageable Java Virtual Machine. Various things can be queried for in this JVM. An MBean correponding to this JVM will be registered in the MBeanServer. The JVM will be always associated with a Server Instance or the Admin Server. JVMPI will be used to get certain management information from a running JVM.

For iAS SE it is thought that there will be one JVM per Server Instance. But it should be possible to have multiple JVMs.

ObjectName of this MBean is: ias:type=jvm, ServerInstance=

Fields Summary
private static final String[]
MAPLIST
private static final String[]
ATTRIBUTES
private static final String[]
OPERATIONS
private final String
JVM_NODE_PATH
Constructors Summary
public ManagedJVM()
Default constructor sets MBean description tables


                     
       
    
        this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS);
    
public ManagedJVM(String instanceName)
Constructs Config MBean for JAVA-CONFIG.

param
instanceName The server instance name.

        this(); //set description tables
        initialize(ObjectNames.kJvmType, new String[]{instanceName});
    
Methods Summary
public voidcreateProfiler(java.lang.String name, java.lang.String classpath, java.lang.String nativeLibraryPath, java.lang.Boolean enabled)
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.

        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();
    
public voiddeleteProfiler()
This operation deletes Profiler according to id if it connected to current HTTP Service.

throws
ConfigException in case of failure.

        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        javaConfig.setProfiler(null);
        getConfigContext().flush();
    
public java.lang.String[]getJvmOptions()
This operation returns list of JvmOptions connected to this class.

        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        return javaConfig.getJvmOptions();
    
public java.lang.StringgetProfiler()
Returns the name of the profiler this JVM is configured with. Returns null if no profiler is registered.

        String profilerName = null;
        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        Profiler profiler = javaConfig.getProfiler();
        if (profiler != null)
        {
            profilerName = profiler.getName();
        }
        return profilerName;
    
public booleanisProfilerExist()
This operation returns true if Profiler connected to current HTTP Service.

throws
ConfigException in case of failure.

        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        return  (javaConfig.getProfiler()!=null);
    
public voidsetJvmOptions(java.lang.String[] options)
This operation returns list of JvmOptions connected to this class.

        JavaConfig  javaConfig  = (JavaConfig)getBaseConfigBean();
        javaConfig.setJvmOptions(options);
        getConfigContext().flush();