|
Think of a Server as a layer cake. On the bottom is a Java Virtual Machine (JVM). IBM puts a JVM MBean in front of this layer. Above that is IBM's implementation of the J2EE spec. IBM puts a Server MBean in front of that implementation. Above that, your applications run.
The following tables illustrate some of the things you can do with the Server layer of an application server. The Server layer is IBM's implementation of Sun's J2EE spec
The following lines of python script are needed to prepare for the one line scripts below
| line of code | description |
raw = AdminControl.queryNames( "type=Server,*" )
This gets you the names of each of the MBeans that control each server in your cell.
array = raw.splitlines()
Convert the text you got in the previous line into a Python array
theChosenMBean = array[0]
Pick whichever Server you want to use in the code below. There will be one element in the array for every Server MBean in your cell
Run any one of the lines below after you run the setup code above
| line of code | description |
print Help.attributes( theChosenMBean )
Find out all the attributes you can read with this MBean
print Help.operations( theChosenMBean )
Find out everything you can do with this MBean
AdminControl.invoke( theChosenMBean, 'getVersionForAllProducts' )
Get version information
AdminControl.invoke( theChosenMBean, 'getVersionForAllComponents' )
Get version information
AdminControl.invoke( theChosenBean, 'getDeployedObjects' )
Find everything that is deployed on this Server
AdminControl.invoke( theChosenBean, 'getResources' )
Find out what resources on this Server
The following tables illustrate some of the things you can do with the Java Virtual Machine layer of an application server
The following lines of python script are needed to prepare for the one line scripts below. Notice that all we changed is the type of MBean that we search for. This time, we search for a JVM type MBean instead of a Server type MBean
| line of code | description |
raw = AdminControl.queryNames( "type=JVM,*" )
This gets you the names of each of the MBeans that control each server in your cell.
array = raw.splitlines()
Convert the text you got in the previous line into a Python array
theChosenMBean = array[0]
Pick whichever Java virtual machine you want to use in the code below. There will be one element in the array for every JVM in your cell
Run any one of the lines below after you run the setup code above
| line of code | description |
print Help.attributes( theChosenMBean )
Find out all the attributes you can read with this MBean
print Help.operations( theChosenMBean )
Find out everything you can do with this MBean
AdminControl.invoke( theChosenMBean, 'generateHeapDump' )
Generate a heap dump from the Server behind this MBean
AdminControl.invoke( theChosenMBean, 'dumpThreads' )
Generate a thread dump from the Server behind this MBean
AdminControl.invoke( theChosenMBean, 'getStats' )
Get memory and CPU usage information about the Server behind this MBean
AdminControl.invoke( theChosenMBean, 'getVersionForAllComponents' )
Get version information
|