當前位置: 首頁>>代碼示例>>Java>>正文


Java MBeanInfo.getClassName方法代碼示例

本文整理匯總了Java中javax.management.MBeanInfo.getClassName方法的典型用法代碼示例。如果您正苦於以下問題:Java MBeanInfo.getClassName方法的具體用法?Java MBeanInfo.getClassName怎麽用?Java MBeanInfo.getClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.management.MBeanInfo的用法示例。


在下文中一共展示了MBeanInfo.getClassName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getColumnText

import javax.management.MBeanInfo; //導入方法依賴的package包/類
@Override
public String getColumnText(Object element, int columnIndex) {

    // 0:ObjectName | 1:Class Name | 2:Description

    MBeanModel model = (MBeanModel) element;
    MBean mbean = model.getData();
    MBeanInfo info = mbean.getInfo();
    switch (columnIndex) {

    case 0:
        return mbean.getObjectName().toString();

    case 1:
        return info.getClassName();

    case 2:
        return info.getDescription();
    }
    return null;
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:22,代碼來源:MBeanModelElementType.java

示例2: getMBeanInfo

import javax.management.MBeanInfo; //導入方法依賴的package包/類
/**
 * Return the MBeanInfo for the given resource, based on the given
 * per-interface data.
 */
final MBeanInfo getMBeanInfo(Object resource, PerInterface<M> perInterface) {
    MBeanInfo mbi =
            getClassMBeanInfo(resource.getClass(), perInterface);
    MBeanNotificationInfo[] notifs = findNotifications(resource);
    if (notifs == null || notifs.length == 0)
        return mbi;
    else {
        return new MBeanInfo(mbi.getClassName(),
                mbi.getDescription(),
                mbi.getAttributes(),
                mbi.getConstructors(),
                mbi.getOperations(),
                notifs,
                mbi.getDescriptor());
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:21,代碼來源:MBeanIntrospector.java

示例3: getMBeanInfo

import javax.management.MBeanInfo; //導入方法依賴的package包/類
@Override
public MBeanInfo getMBeanInfo() {
    MBeanInfo mbi = super.getMBeanInfo();
    Class<?> resourceClass = getResource().getClass();
    if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass))
        return mbi;
    return new MBeanInfo(mbi.getClassName(), mbi.getDescription(),
            mbi.getAttributes(), mbi.getConstructors(),
            mbi.getOperations(),
            MBeanIntrospector.findNotifications(getResource()),
            mbi.getDescriptor());
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:StandardMBeanSupport.java

示例4: bindAttributes

import javax.management.MBeanInfo; //導入方法依賴的package包/類
/**
 * @param jmxServerConnection
 * @param resultproperty
 * @param pname
 * @param oname
 */
protected void bindAttributes(MBeanServerConnection jmxServerConnection, String resultproperty, String pname, ObjectName oname) {
    if (jmxServerConnection != null  && resultproperty != null 
        && pname != null && oname != null ) {
        try {
            MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname);
            String code = minfo.getClassName();
            if ("org.apache.tomcat.util.modeler.BaseModelMBean".equals(code)) {
                code = (String) jmxServerConnection.getAttribute(oname,
                        "modelerType");
            }
            MBeanAttributeInfo attrs[] = minfo.getAttributes();
            Object value = null;

            for (int i = 0; i < attrs.length; i++) {
                if (!attrs[i].isReadable())
                    continue;
                String attName = attrs[i].getName();
                if (attName.indexOf("=") >= 0 || attName.indexOf(":") >= 0
                        || attName.indexOf(" ") >= 0) {
                    continue;
                }

                try {
                    value = jmxServerConnection
                            .getAttribute(oname, attName);
                } catch (Throwable t) {
                    if (isEcho())
                        handleErrorOutput("Error getting attribute "
                                + oname + " " + pname + attName + " "
                                + t.toString());
                    continue;
                }
                if (value == null)
                    continue;
                if ("modelerType".equals(attName))
                    continue;
                createProperty(pname + attName, value);
            }
        } catch (Exception e) {
            // Ignore
        }
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:50,代碼來源:JMXAccessorQueryTask.java


注:本文中的javax.management.MBeanInfo.getClassName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。