Example usage for javax.management.openmbean OpenMBeanOperationInfo getName

List of usage examples for javax.management.openmbean OpenMBeanOperationInfo getName

Introduction

In this page you can find the example usage for javax.management.openmbean OpenMBeanOperationInfo getName.

Prototype

public String getName();

Source Link

Document

Returns the name of the operation described by this OpenMBeanOperationInfo instance.

Usage

From source file:com.cyberway.issue.crawler.admin.CrawlJob.java

protected void addBdbjeOperations(final List<OpenMBeanOperationInfo> operations,
        final List<MBeanOperationInfo> bdbjeOperations, final List<String> bdbjeNamesToAdd) {
    for (MBeanOperationInfo info : bdbjeOperations) {
        if (bdbjeNamesToAdd.contains(info.getName())) {
            OpenMBeanOperationInfo omboi = null;
            if (info.getName().equals(OP_DB_STAT)) {
                // Db stats needs special handling. The published
                // signature is wrong and its return type is awkward.
                // Handle it.
                omboi = JmxUtils.convertToOpenMBeanOperation(info, null, SimpleType.STRING);
                MBeanParameterInfo[] params = omboi.getSignature();
                OpenMBeanParameterInfo[] args = new OpenMBeanParameterInfoSupport[params.length + 1];
                for (int ii = 0; ii < params.length; ii++) {
                    args[ii] = (OpenMBeanParameterInfo) params[ii];
                }//from   www .  ja v  a 2s  .com
                args[params.length] = new OpenMBeanParameterInfoSupport("name", "Database name",
                        SimpleType.STRING);
                omboi = new OpenMBeanOperationInfoSupport(omboi.getName(), omboi.getDescription(), args,
                        omboi.getReturnOpenType(), omboi.getImpact());
            } else {
                omboi = JmxUtils.convertToOpenMBeanOperation(info);
            }
            operations.add(omboi);
        }
    }
}