Tuesday 27 March 2012

AdminControl object in wsadmin scripting

The AdminControl object is similar in many ways to the AdminConfig object. The primary difference between the two is that the AdminConfig object is used to manipulate configuration objects (represented using XML), and the AdminControl object is used to manipulate active application server objects (by interacting with managed beans—MBeans). One implication of this is that in order for this object to function, wsadmin must be connected to an active application server (the AdminControl object is not available when wsadmin is used in local mode)

The AdminControl object enables the manipulation of MBeans running in a WebSphere server process.  The number and type of MBeans available to the scripting client depends on the server to which the client is connected.  If the client is connected to a Deployment Manager, then all the MBeans running in the Deployment Manager are visible, as are all the MBeans running in the Node Agents connected to this Deployment Manager, and all the MBeans running in the application servers on those nodes.

The AdminControl scripting object is used for operational control. It communicates with MBeans that represent live objects running a WebSphere® server process. It includes commands to query existing running objects and their attributes and invoke operation on the running objects. In addition to the operational commands, the AdminControl object supports commands to query information on the connected server, convenient commands for client tracing, reconnecting to a server, and start and stop server for network deployment environment.

Note that many of these commands support two different sets of signatures: one that accepts and returns strings, and one low-level  set that works with JMX objects like ObjectName and AttributeList. In most situations, the string signatures are likely to be more useful,  but JMX-object signature versions are supplied as well.  Each of these JMX-object signature commands has "_jmx" appended to the command name. Hence there is an "invoke" command, as well as a "invoke_jmx" command.

To see a list of all available commands for the AdminControl object:
Print  AdminControl.help()

Methods in AdminControl

Name
Description
completeObjectName          
Return a String version of an object name given a template name
getAttribute_jmx
Given ObjectName and name of attribute, returns value of attribute
getAttribute   
Given String version of ObjectName and name of attribute, returns value of attribute
getAttributes_jmx
Given ObjectName and array of attribute names, returns AttributeList.
getAttributes  
Given String version of ObjectName and attribute names,returns String of name value pairs.
getCell        
returns the cell name of the connected server
getConfigId    
Given String version of ObjectName, return a configuration ID for  the corresponding configuration object, if any.
getDefaultDomain
returns "WebSphere"
getDomainName  
returns "WebSphere”
getHost        
returns String representation of connected host
getMBeanCount  
returns number of registered beans
getMBeanInfo_jmx
Given ObjectName, returns MBeanInfo structure for MBean
getNode        
returns the node name of the connected server
getObjectInstance
Given String version of ObjectName, returns
 ObjectInstance object that match.
getPort        
returns String representation of port in use
getType        
returns String representation of connection type in use
help           
Show help information
invoke_jmx     
Given ObjectName, name of method, array of parameters and signature, invoke method on MBean specified
invoke         
Invoke a method on the specified MBean
isRegistered_jmx          
true if supplied ObjectName is registered
isRegistered  
true if supplied String version of ObjectName is registered
makeObjectName 
Return an ObjectName built with the given string
queryNames_jmx 
Given ObjectName and QueryExp, retrieves set of ObjectNames that match
queryNames     
Given String version of ObjectName, retrieves String of ObjectNames that match.
queryMBeans    
Given String version of ObjectName, returns a set of ObjectInstances object that match.
reconnect      
reconnects with server
setAttribute_jmx               
Given ObjectName and Attribute object, set attribute for MBean specified
setAttribute   
Given String version of ObjectName, attribute name and attribute value, set attribute for MBean specified
setAttributes_jmx     
Given ObjectName and AttributeList object, set attributes for the MBean specified
setAttributes  
Given String version of ObjectName, attribute name and value pairs, set attributes for the MBean specified
startServer    
Given the name of a server, start that server
stopServer     
Given the name of a server, stop that server.
testConnection 
Test the connection to a DataSource object
trace          
Set the wsadmin trace specification

No comments:

Post a Comment