Example usage for javax.management MBeanServerConnection setAttributes

List of usage examples for javax.management MBeanServerConnection setAttributes

Introduction

In this page you can find the example usage for javax.management MBeanServerConnection setAttributes.

Prototype

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

Source Link

Document

Sets the values of several attributes of a named MBean.

Usage

From source file:org.helios.collector.jmx.connection.AbstractMBeanServerConnectionFactory.java

/**
 * Sets the value of a list of attributes
 * @param objectName//w w w .  j a  v a  2 s .c o  m
 * @param attributeList
 * @return
 * @throws InstanceNotFoundException
 * @throws ReflectionException
 * @throws IOException
 */
@Override
@ManagedOperation
public AttributeList setAttributes(ObjectName objectName, AttributeList attributeList)
        throws InstanceNotFoundException, ReflectionException, IOException {
    validateConn();
    MBeanServerConnection conn = null;
    try {
        conn = getPooledConnection();
        return conn.setAttributes(objectName, attributeList);
    } catch (MBeanServerConnectionFactoryException e) {
        throw new RuntimeException("Failed to get pooled connection", e);
    } finally {
        try {
            this.returnPooledConnection(conn);
        } catch (Exception e) {
            log.debug(e.getMessage());
        }
    }
}