当前位置: 首页>>代码示例>>Java>>正文


Java MBeanOperationInfo.getSignature方法代码示例

本文整理汇总了Java中javax.management.MBeanOperationInfo.getSignature方法的典型用法代码示例。如果您正苦于以下问题:Java MBeanOperationInfo.getSignature方法的具体用法?Java MBeanOperationInfo.getSignature怎么用?Java MBeanOperationInfo.getSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.management.MBeanOperationInfo的用法示例。


在下文中一共展示了MBeanOperationInfo.getSignature方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOperationName

import javax.management.MBeanOperationInfo; //导入方法依赖的package包/类
public static final String getOperationName(MBeanOperationInfo info) {
    StringBuilder name = new StringBuilder(info.getName());
    name.append('(');

    MBeanParameterInfo[] parameterInfos = info.getSignature();

    if (parameterInfos != null) {

        int parameterCount = parameterInfos.length;
        for (int i = 0; i < parameterCount; i++) {
            MBeanParameterInfo parameterInfo = parameterInfos[i];
            String parameterType = getTypeName(parameterInfo.getType(), parameterInfo.getDescriptor());
            name.append(parameterType);

            if (i < parameterCount - 1) {
                name.append(", ");
            }
        }

    }

    name.append(')');
    return name.toString();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:25,代码来源:JmxUtils.java

示例2: invokeOperationInternal

import javax.management.MBeanOperationInfo; //导入方法依赖的package包/类
/**
 * Invokes an operation on an MBean.
 * @param onameStr The name of the MBean.
 * @param operation The name of the operation to invoke.
 * @param parameters An array of Strings containing the parameters to the
 *                   operation. They will be converted to the appropriate
 *                   types to call the reuested operation.
 * @return The value returned by the requested operation.
 */
private Object invokeOperationInternal(String onameStr,
                                       String operation,
                                       String[] parameters)
    throws OperationsException, MBeanException, ReflectionException {
    ObjectName oname=new ObjectName( onameStr );
    MBeanOperationInfo methodInfo = registry.getMethodInfo(oname,operation);
    MBeanParameterInfo[] signature = methodInfo.getSignature();
    String[] signatureTypes = new String[signature.length];
    Object[] values = new Object[signature.length];
    for (int i = 0; i < signature.length; i++) {
       MBeanParameterInfo pi = signature[i];
       signatureTypes[i] = pi.getType();
       values[i] = registry.convertValue(pi.getType(), parameters[i] );
     }

    return mBeanServer.invoke(oname,operation,values,signatureTypes);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:JMXProxyServlet.java

示例3: invokeOperationInternal

import javax.management.MBeanOperationInfo; //导入方法依赖的package包/类
/**
 * Invokes an operation on an MBean.
 * 
 * @param onameStr
 *            The name of the MBean.
 * @param operation
 *            The name of the operation to invoke.
 * @param parameters
 *            An array of Strings containing the parameters to the
 *            operation. They will be converted to the appropriate types to
 *            call the requested operation.
 * @return The value returned by the requested operation.
 */
private Object invokeOperationInternal(String onameStr, String operation, String[] parameters)
		throws OperationsException, MBeanException, ReflectionException {
	ObjectName oname = new ObjectName(onameStr);
	MBeanOperationInfo methodInfo = registry.getMethodInfo(oname, operation);
	MBeanParameterInfo[] signature = methodInfo.getSignature();
	String[] signatureTypes = new String[signature.length];
	Object[] values = new Object[signature.length];
	for (int i = 0; i < signature.length; i++) {
		MBeanParameterInfo pi = signature[i];
		signatureTypes[i] = pi.getType();
		values[i] = registry.convertValue(pi.getType(), parameters[i]);
	}

	return mBeanServer.invoke(oname, operation, values, signatureTypes);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:29,代码来源:JMXProxyServlet.java

示例4: getMethod

import javax.management.MBeanOperationInfo; //导入方法依赖的package包/类
/**
 * Extracts the Method from the MBeanOperationInfo
 * 
 * @param op
 * @return
 */
private Method getMethod(final MBeanOperationInfo op) {
	final MBeanParameterInfo[] params = op.getSignature();
	final String[] paramTypes = new String[params.length];
	for (int i = 0; i < params.length; i++) {
		paramTypes[i] = params[i].getType();
	}
	return getMethod(getMBeanInterface(), op.getName(), paramTypes);
}
 
开发者ID:ggrandes,项目名称:metrics-tomcat,代码行数:15,代码来源:AnnotatedStandardMBean.java


注:本文中的javax.management.MBeanOperationInfo.getSignature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。