setAttribute

public void setAttribute( ObjectName name, 
                          Attribute attribute)
  throws InstanceNotFoundException, 
         AttributeNotFoundException, 
         InvalidAttributeValueException, 
         MBeanException, 
         ReflectionException;
This method is used to set the name and value of a new Attribute or to update the current value of an Attribute. The following example shows how to use the JMX-instrument MQe queue MBean known by object name queueObjName to set the Description attribute at the agent level:
Attribute descAttr = 
  new Attribute("Description","A description for my queue"); 
mbeanServer.setAttribute(queueObjName, descAttr);

Some adapters such as the Sun HtmlAdaptorServer invoke the getAttribute() and setAttribute() methods recursively when getting or setting several attributes rather than invoking getAttributes() or setAttributes(). This may result in a high overhead. In this case, it would be a good idea to increase the cacheInterval attribute in the Admin MBean (see reference Admin MBean). Caching attribute values will decrease the amount of work being done by the adaptor.


Terms of use | WebSphere software

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