Example usage for javax.management.openmbean OpenMBeanOperationInfo getReturnOpenType

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

Introduction

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

Prototype

public OpenType<?> getReturnOpenType();

Source Link

Document

Returns the open type of the values returned by 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];
                }/*ww w  .j a v a  2 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);
        }
    }
}