setAttributes

public AttributeList setAttributes( ObjectName name, 
                                    AttributeList attribute)
  throws InstanceNotFoundException, 
         ReflectionException;

This method is used to set or update several Attributes at once. The following example shows how to use the JMX-instrumented MQe queue MBean known by object name queueObjName, to set the Description and Expiry attributes at the agent level:

/*create the attributes to update */
Attribute descAttr = 
  new Attribute("Description","A new description for my queue");
Attribute expiryAttr = 
  new Attribute("Expiry", new Long(1000));

/*create the input parameter AttributeList   */
/* and add our Attributes to the List        */  
AttributeList toUpdate = new AttributeList();
toUpdate.add(descAttr);
toUpdate.add(expiryAttr);

/* call setAttributes() and check results if required */
AttributeList updates = mbeanServer.setAttributes(queueObjName, toUpdate);
/* can now process updates as shown in getAttributes() */
Note: The same limitations apply to error handling for setAttributes as those described earlier for getAttributes().

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.