本文整理汇总了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;
}
示例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;
}
示例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");
}
示例4: descriptorForElement
public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
if (elmt == null)
return ImmutableDescriptor.EMPTY_DESCRIPTOR;
final Annotation[] annots = elmt.getAnnotations();
return descriptorForAnnotations(annots);
}