org.jboss.system.server
Class ServerInfo

java.lang.Object
  extended by org.jboss.system.server.ServerInfo
All Implemented Interfaces:
MBeanRegistration, ServerInfoMBean

public class ServerInfo
extends Object
implements ServerInfoMBean, MBeanRegistration

An MBean that provides a rich view of system information for the JBoss server in which it is deployed.

Version:
$Revision: 87850 $
Author:
Rickard Oberg, Scott Stark, Hiram Chirino, Jason Dillon, Marc Fleury, Dimitris Andreadis, Galder Zamarreno

Field Summary
 
Fields inherited from interface org.jboss.system.server.ServerInfoMBean
OBJECT_NAME_STR
 
Constructor Summary
ServerInfo()
           
 
Method Summary
 String displayPackageInfo(String pkgName)
          Display the java.lang.Package info for the pkgName
 Integer getActiveThreadCount()
           
 Integer getActiveThreadGroupCount()
           
 Integer getAvailableProcessors()
          Returns Runtime.getRuntime().availableProcessors() on JDK 1.4 vms or -1 on previous versions.
 Long getFreeMemory()
           
 String getHostAddress()
          Returns InetAddress.getLocalHost().getHostAddress();
 String getHostName()
          Returns InetAddress.getLocalHost().getHostName();
 String getJavaVendor()
           
 String getJavaVersion()
           
 String getJavaVMName()
           
 String getJavaVMVendor()
           
 String getJavaVMVersion()
           
 Long getMaxMemory()
          Returns Runtime.getRuntime().maxMemory() on JDK 1.4 vms or -1 on previous versions.
 String getOSArch()
           
 String getOSName()
           
 String getOSVersion()
           
 Long getTotalMemory()
           
 String listMemoryPools(boolean fancy)
          Return a listing of the thread pools on jdk5+.
 String listThreadCpuUtilization()
          Return a listing of the active threads and thread groups.
 String listThreadDump()
          Return a listing of the active threads and thread groups.
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerInfo

public ServerInfo()
Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

getJavaVersion

public String getJavaVersion()
Specified by:
getJavaVersion in interface ServerInfoMBean

getJavaVendor

public String getJavaVendor()
Specified by:
getJavaVendor in interface ServerInfoMBean

getJavaVMName

public String getJavaVMName()
Specified by:
getJavaVMName in interface ServerInfoMBean

getJavaVMVersion

public String getJavaVMVersion()
Specified by:
getJavaVMVersion in interface ServerInfoMBean

getJavaVMVendor

public String getJavaVMVendor()
Specified by:
getJavaVMVendor in interface ServerInfoMBean

getOSName

public String getOSName()
Specified by:
getOSName in interface ServerInfoMBean

getOSVersion

public String getOSVersion()
Specified by:
getOSVersion in interface ServerInfoMBean

getOSArch

public String getOSArch()
Specified by:
getOSArch in interface ServerInfoMBean

getTotalMemory

public Long getTotalMemory()
Specified by:
getTotalMemory in interface ServerInfoMBean

getFreeMemory

public Long getFreeMemory()
Specified by:
getFreeMemory in interface ServerInfoMBean

getMaxMemory

public Long getMaxMemory()
Returns Runtime.getRuntime().maxMemory() on JDK 1.4 vms or -1 on previous versions.

Specified by:
getMaxMemory in interface ServerInfoMBean
Returns:
Runtime.getRuntime().maxMemory() on JDK 1.4 vms or -1 on previous versions.

getAvailableProcessors

public Integer getAvailableProcessors()
Returns Runtime.getRuntime().availableProcessors() on JDK 1.4 vms or -1 on previous versions.

Specified by:
getAvailableProcessors in interface ServerInfoMBean
Returns:
Runtime.getRuntime().availableProcessors() on JDK 1.4 vms or -1 on previous versions.

getHostName

public String getHostName()
Returns InetAddress.getLocalHost().getHostName();

Specified by:
getHostName in interface ServerInfoMBean
Returns:
InetAddress.getLocalHost().getHostName();

getHostAddress

public String getHostAddress()
Returns InetAddress.getLocalHost().getHostAddress();

Specified by:
getHostAddress in interface ServerInfoMBean
Returns:
InetAddress.getLocalHost().getHostAddress();

listMemoryPools

public String listMemoryPools(boolean fancy)
Return a listing of the thread pools on jdk5+.

Specified by:
listMemoryPools in interface ServerInfoMBean
Parameters:
fancy - produce a text-based graph when true
Returns:
the memory pools

getActiveThreadCount

public Integer getActiveThreadCount()
Specified by:
getActiveThreadCount in interface ServerInfoMBean

getActiveThreadGroupCount

public Integer getActiveThreadGroupCount()
Specified by:
getActiveThreadGroupCount in interface ServerInfoMBean

listThreadDump

public String listThreadDump()
Return a listing of the active threads and thread groups.

Specified by:
listThreadDump in interface ServerInfoMBean
Returns:
the thread dump

listThreadCpuUtilization

public String listThreadCpuUtilization()
Return a listing of the active threads and thread groups.

Specified by:
listThreadCpuUtilization in interface ServerInfoMBean
Returns:
the cpu utilization

displayPackageInfo

public String displayPackageInfo(String pkgName)
Display the java.lang.Package info for the pkgName

Specified by:
displayPackageInfo in interface ServerInfoMBean
Parameters:
pkgName - the package name
Returns:
the package info


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.