Example usage for javax.management.openmbean OpenMBeanOperationInfo getImpact

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

Introduction

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

Prototype

public int getImpact();

Source Link

Document

Returns an int constant qualifying the impact 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];
                }// ww  w.  j a  va2 s .  co  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);
        }
    }
}