Example: Representing lists and javax.management.AttributeList objects with strings when scripting

Represent lists and javax.management.AttributeList objects using strings when scripting. These objects have different syntax conventions depending on the scripting language and whether the list or AttributeList object is input or output. The JMX Specification states that...

The Attribute and AttributeList objects are typically used for conveying the attribute values of an MBean, as the result of a getter operation, or as the argument of a setter operation.

 

Jacl

When using the Jacl interface, construct lists using the standard Jacl list syntax. For example, a list of two attribute names might look like: {passivationDirectory inactivePoolCleanupInterval} On output, the wsadmin tool does not display the enclosing brackets, and you can manipulate the result as a Jacl list. An AttributeList object is represented by a Jacl list. The outer enclosing list represents the entire AttributeList class and can have any number of interior lists. The interior lists each have a length of two, where the first element is the attribute name, and the second element is a string representation of the attribute value. For example, {{passivationDirectory c:/temp}}{{passivationDirectory /temp}} is an attribute list containing a single attribute name and value, and {{traceSpecification com.ibm.*=all=enabled} {ringBufferSize 0}} contains two attributes. Enter input (in a script) string AttributeLists exactly like this. If the value of the attribute contains a space, then enclose the value in another set of curly braces, or in double quotes: {{passivationDirectory "c:/My Folder/temp"}}{{passivationDirectory "/My Folder/temp"}} On output, the outer set of parenthesis does not display, which makes the output value a Jacl list that the script can easily manipulate.

 

Jython

When using the Jython interface, construct lists using the standard Jython list syntax. For example, a list of two attribute names might look like the following: [['passivationDirectory', 'inactivePoolCleanupInterval']]. You can manipulate the result as a Jython list. An AttributeList object is represented by a Jython list. The outer enclosing list represents the entire AttributeList class and can have any number of interior lists. The interior lists each have a length of two where the first element is the attribute name, and the second element is a string representation of the attribute value. For example, [['passivationDirectory', 'c:/temp']][['passivationDirectory', '/temp']] is an attribute list containing a single attribute name and value, and [['traceSpecification', 'com.ibm.*=all=enabled'], ['ringBufferSize', 0]] contains two attributes. Enter input (in a script) string AttributeLists exactly like this. If the value of the attribute contains a space, then enclose the value in double quote: [['passivationDirectory', "c:/My Folder/temp"]][['passivationDirectory', "/My Folder/temp"]].