ObjectName, Attribute, and AttributeList classes
WebSphere Application Server scripting commands use the underlying JMX classes, ObjectName, Attribute, and AttributeList, to manipulate object names, attributes and attribute lists respectively.
The ObjectName class uniquely identifies running objects. The ObjectName class consists of the following elements:
- The domain name WebSphere.
- Several key properties, for example:
- type indicates the type of object that is accessible through the MBean, for example, ApplicationServer, and EJBContainer.
- name represents the display name of the particular object, for example, MyServer.
- node represents the name of the node on which the object runs.
- process represents the name of the server process in which the object runs.
- mbeanIdentifier correlates the MBean instance with corresponding configuration data.
When ObjectName classes are represented by strings, they have the following pattern:
[domainName]:property=value[,property=value]*
For example, we can specify WebSphere:name="My Server",type=ApplicationServer,node=n1,* to specify an application server named My Server on node n1. (The asterisk (*) is a wildcard character, used so that we do not have to specify the entire set of key properties.) The AdminControl commands that take strings as parameters expect strings that look like this example when specifying running objects (MBeans). We can obtain the object name for a running object with the getObjectName command.
Attributes of these objects consist of a name and a value. We can extract the name and value with the getName and the getValue methods that are available in the javax.management.Attribute class. We can also extract a list of attributes.