Use scripting and the wsadmin tool to specify running objects.
Before starting this task, the wsadmin tool must be running. See the topic on starting the wsadmin scripting client.
You can run wsadmin commands that obtain object names and specify running objects.
set var [$AdminControl completeObjectName template]
var = AdminControl.completeObjectName(template)
Element | Description |
---|---|
set | is a Jacl command |
var | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans running in a WebSphere® server process |
completeObjectName | is an AdminControl command |
template | is a string containing a segment of the object name to be matched. The template has the same format as an object name with the following pattern: [domainName]:property=value[,property=value]*. For more information, see Object name, Attribute, Attribute list. |
If there are several MBeans that match the template, the completeObjectName command only returns the first match. The matching MBean object name is then assigned to a variable.
To look for server1 MBean in mynode, use the following example:
set server1 [$AdminControl completeObjectName node=mynode,type=Server,name=server1,*]
server1 = AdminControl.completeObjectName('node=mynode,type=Server,name=server1,*')
set var [$AdminControl queryNames template]
var = AdminControl.queryNames(template)
Element | Description |
---|---|
set | is a Jacl command |
var | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminControl | is an object that enables the manipulation of MBeans running in a product process. |
queryNames | is an AdminControl command |
template | is a string containing a segment of the object name to be matched. The template has the same format as an object name with the following pattern: [domainName]:property=value[,property=value]* |
set allServers [$AdminControl queryNames type=Server,*]
set aServer [lindex $allServers 0]
allServers = AdminControl.queryNames('type=Server,*')
# get line separator
import java
lineSeparator = java.lang.System.getProperty('line.separator')
aServer = allServers.split(lineSeparator)[0]
For other ways to manipulate the list and then perform pattern matching to look for a specified configuration object, refer to the topic on Jacl syntax.
You can now use the running object in with other AdminControl commands that require an object name as a parameter.