Java Code Examples for javax.management.ImmutableDescriptor#EMPTY_DESCRIPTOR

The following examples show how to use javax.management.ImmutableDescriptor#EMPTY_DESCRIPTOR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardMBeanIntrospector.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 2
Source File: StandardMBeanIntrospector.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 3
Source File: StandardMBeanIntrospector.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 4
Source File: ImmutableDescriptorSerialTest.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 5
Source File: StandardMBeanIntrospector.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
@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;
}
 
Example 6
Source File: MXBeanIntrospector.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 7
Source File: ImmutableDescriptorSerialTest.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 8
Source File: MXBeanIntrospector.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 9
Source File: StandardMBeanIntrospector.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 10
Source File: StandardMBeanIntrospector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 11
Source File: ImmutableDescriptorSerialTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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");
}
 
Example 12
Source File: MXBeanIntrospector.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 13
Source File: StandardMBeanIntrospector.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 14
Source File: MXBeanIntrospector.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 15
Source File: StandardMBeanIntrospector.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 16
Source File: MXBeanIntrospector.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 17
Source File: Introspector.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
    if (elmt == null)
        return ImmutableDescriptor.EMPTY_DESCRIPTOR;
    final Annotation[] annots = elmt.getAnnotations();
    return descriptorForAnnotations(annots);
}
 
Example 18
Source File: Introspector.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
    if (elmt == null)
        return ImmutableDescriptor.EMPTY_DESCRIPTOR;
    final Annotation[] annots = elmt.getAnnotations();
    return descriptorForAnnotations(annots);
}
 
Example 19
Source File: Introspector.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
    if (elmt == null)
        return ImmutableDescriptor.EMPTY_DESCRIPTOR;
    final Annotation[] annots = elmt.getAnnotations();
    return descriptorForAnnotations(annots);
}
 
Example 20
Source File: Introspector.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
    if (elmt == null)
        return ImmutableDescriptor.EMPTY_DESCRIPTOR;
    final Annotation[] annots = elmt.getAnnotations();
    return descriptorForAnnotations(annots);
}