Example usage for javax.management.openmbean OpenMBeanOperationInfo getSignature

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

Introduction

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

Prototype

public MBeanParameterInfo[] getSignature();

Source Link

Document

Returns an array of OpenMBeanParameterInfo instances describing each parameter in the signature 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 ww w . j  a va2  s  . c  o m
                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);
        }
    }
}