Identify attributes and operations for running objects with the wsadmin tool
Overview
You can use scripting to identify attributes and operations for running objects.
Use the attributes or operations commands of the Help object to find information on a running MBean in the server.
### attr.py
###
### Usage:
###
### wsadmin.sh -lang jython -f attr.py
###
### Get line separator
import java
ls = java.lang.System.getProperty('line.separator')
### Specify a running object.
allServers = AdminControl.queryNames('type=Server,*')
aServer = allServers.split(ls)[0]
### Use the attributes command to display the attributes of the running object:
print Help.attributes(aServer)
### Use the operations command to find out the operations that are supported by the MBean:
print Help.operations(aServer)
### Or use...
### Help.operations(MBeanObjectname, operationName)If you do not provide the operationName value, all the operations that are supported by the MBean return with the signature for each operation. If you specify the operationName value, only the operation specified returns and it contains details which include the input parameters and the return value.
To display the operations for the server MBean...
server = AdminControl.completeObjectName('type=Server,name=server1,*')
print Help.operations(server)To display detailed information about the stop operation, use the following example:
print Help.operations(server, 'stop')Example...
[wasuser@host wsadmin]$ wsadmin.sh -lang jython -f attr.py Attribute Type Access name java.lang.String RO shortName java.lang.String RO threadMonitorInterval int RW threadMonitorThreshold int RW threadMonitorAdjustmentThreshold int RW pid java.lang.String RO cellName java.lang.String RO cellShortName java.lang.String RO deployedObjects [Ljava.lang.String; RO javaVMs [Ljava.lang.String; RO nodeName java.lang.String RO nodeShortName java.lang.String RO processType java.lang.String RO resources [Ljava.lang.String; RO serverVersion java.lang.String RO serverVendor java.lang.String RO state java.lang.String RO platformName java.lang.String RO platformVersion java.lang.String RO objectName java.lang.String RO stateManageable boolean RO statisticsProvider boolean RO eventProvider boolean RO eventTypes [Ljava.lang.String; RO Operation java.lang.String getName() int getThreadMonitorInterval() void setThreadMonitorInterval(int) int getThreadMonitorThreshold() void setThreadMonitorThreshold(int) int getThreadMonitorAdjustmentThreshold() void setThreadMonitorAdjustmentThreshold(int) java.lang.String getPid() java.lang.String getCellName() [Ljava.lang.String; getDeployedObjects() [Ljava.lang.String; getJavaVMs() java.lang.String getNodeName() java.lang.String getNodeShortName() java.lang.String getProcessType() [Ljava.lang.String; getResources() java.lang.String getServerVersion() java.lang.String getServerVendor() java.lang.String getState() java.lang.String getPlatformName() java.lang.String getPlatformVersion() java.lang.String getProductVersion(java.lang.String) java.lang.String getComponentVersion(java.lang.String) java.lang.String getEFixVersion(java.lang.String) java.lang.String getPTFVersion(java.lang.String) java.lang.String getExtensionVersion(java.lang.String) [Ljava.lang.String; getVersionsForAllProducts() [Ljava.lang.String; getVersionsForAllComponents() [Ljava.lang.String; getVersionsForAllEFixes() [Ljava.lang.String; getVersionsForAllPTFs() [Ljava.lang.String; getVersionsForAllExtensions() void stop() void stopImmediate() void stop(java.lang.Boolean, java.lang.Integer) void restart()