當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。