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


Java ImmutableDescriptor.EMPTY_DESCRIPTOR属性代码示例

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


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

示例1: getBasicMBeanDescriptor

@Override
Descriptor getBasicMBeanDescriptor() {
    /* We don't bother saying mxbean=false, and we can't know whether
       the info is immutable until we know whether the MBean class
       (not interface) is a NotificationBroadcaster. */
    return ImmutableDescriptor.EMPTY_DESCRIPTOR;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:StandardMBeanIntrospector.java

示例2: getMBeanDescriptor

@Override
Descriptor getMBeanDescriptor(Class<?> resourceClass) {
    /* We already have immutableInfo=true in the Descriptor
     * included in the MBeanInfo for the MXBean interface.  This
     * method is being called for the MXBean *class* to add any
     * new items beyond those in the interface Descriptor, which
     * currently it does not.
     */
    return ImmutableDescriptor.EMPTY_DESCRIPTOR;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:MXBeanIntrospector.java

示例3: main

public static void main(String[] args) throws Exception {
    System.out.println("Test that ImmutableDescriptor.EMPTY_DESCRIPTOR " +
            "deserializes identically");
    if (serialize(ImmutableDescriptor.EMPTY_DESCRIPTOR) !=
            ImmutableDescriptor.EMPTY_DESCRIPTOR) {
        throw new Exception("ImmutableDescriptor.EMPTY_DESCRIPTOR did not " +
                "deserialize identically");
    }
    System.out.println("...OK");

    System.out.println("Test that serialization preserves case and " +
            "that deserialized object is case-insensitive");
    Descriptor d = new ImmutableDescriptor("a=aval", "B=Bval", "cC=cCval");
    Descriptor d1 = serialize(d);
    Set<String> keys = new HashSet(Arrays.asList(d1.getFieldNames()));
    if (keys.size() != 3 ||
            !keys.containsAll(Arrays.asList("a", "B", "cC"))) {
        throw new Exception("Keys don't match: " + keys);
    }
    for (String key : keys) {
        String value = (String) d.getFieldValue(key);
        for (String t :
                Arrays.asList(key, key.toLowerCase(), key.toUpperCase())) {
            String tvalue = (String) d1.getFieldValue(t);
            if (!tvalue.equals(value)) {
                throw new Exception("Value of " + key + " for " +
                        "deserialized object does not match: " +
                        tvalue + " should be " + value);
            }
        }
    }
    System.out.println("...OK");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:33,代码来源:ImmutableDescriptorSerialTest.java

示例4: descriptorForElement

public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
    if (elmt == null)
        return ImmutableDescriptor.EMPTY_DESCRIPTOR;
    final Annotation[] annots = elmt.getAnnotations();
    return descriptorForAnnotations(annots);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:Introspector.java


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