Example usage for javax.management.modelmbean ModelMBeanInfo getOperations

List of usage examples for javax.management.modelmbean ModelMBeanInfo getOperations

Introduction

In this page you can find the example usage for javax.management.modelmbean ModelMBeanInfo getOperations.

Prototype

public MBeanOperationInfo[] getOperations();

Source Link

Document

Returns the list of operations of the MBean.

Usage

From source file:org.hyperic.hq.product.jmx.ServiceTypeFactory.java

private void addControlActions(final ServiceType serviceType, ModelMBeanInfo serviceInfo) {
    Set actions = new HashSet();
    final MBeanOperationInfo[] operations = serviceInfo.getOperations();
    for (int i = 0; i < operations.length; i++) {
        actions.add(operations[i].getName());
    }/*from w w  w  .j  a  v  a2 s.  c o  m*/
    serviceType.setControlActions(actions);
}

From source file:org.springframework.jmx.export.MBeanExporter.java

/**
 * Gets the <code>ModelMBeanInfo</code> for the bean with the supplied key
 * and of the supplied type./*from   ww  w .  j a  v a2  s  . c o  m*/
 */
private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    ModelMBeanInfo info = this.assembler.getMBeanInfo(managedBean, beanKey);
    if (logger.isWarnEnabled() && ObjectUtils.isEmpty(info.getAttributes())
            && ObjectUtils.isEmpty(info.getOperations())) {
        logger.warn("Bean with key [" + beanKey
                + "] has been registed as an MBean but has no exposed attributes or operations");
    }
    return info;
}