equal
deleted
inserted
replaced
617 |
617 |
618 /** |
618 /** |
619 * Serializes an {@link MBeanInfo} to an {@link ObjectOutputStream}. |
619 * Serializes an {@link MBeanInfo} to an {@link ObjectOutputStream}. |
620 * @serialData |
620 * @serialData |
621 * For compatibility reasons, an object of this class is serialized as follows. |
621 * For compatibility reasons, an object of this class is serialized as follows. |
622 * <ul> |
622 * <p> |
623 * The method {@link ObjectOutputStream#defaultWriteObject defaultWriteObject()} |
623 * The method {@link ObjectOutputStream#defaultWriteObject defaultWriteObject()} |
624 * is called first to serialize the object except the field {@code descriptor} |
624 * is called first to serialize the object except the field {@code descriptor} |
625 * which is declared as transient. The field {@code descriptor} is serialized |
625 * which is declared as transient. The field {@code descriptor} is serialized |
626 * as follows: |
626 * as follows: |
627 * <ul> |
627 * <ul> |
635 * <li> Otherwise, the method {@link ObjectOutputStream#write write(int val)} |
635 * <li> Otherwise, the method {@link ObjectOutputStream#write write(int val)} |
636 * is called to write a byte with the value {@code 0}, then the method |
636 * is called to write a byte with the value {@code 0}, then the method |
637 * {@link ObjectOutputStream#writeObject writeObject(Object obj)} is called |
637 * {@link ObjectOutputStream#writeObject writeObject(Object obj)} is called |
638 * to serialize the field {@code descriptor} directly. |
638 * to serialize the field {@code descriptor} directly. |
639 * </ul> |
639 * </ul> |
640 * </ul> |
640 * |
641 * @since 1.6 |
641 * @since 1.6 |
642 */ |
642 */ |
643 private void writeObject(ObjectOutputStream out) throws IOException { |
643 private void writeObject(ObjectOutputStream out) throws IOException { |
644 out.defaultWriteObject(); |
644 out.defaultWriteObject(); |
645 |
645 |
659 |
659 |
660 /** |
660 /** |
661 * Deserializes an {@link MBeanInfo} from an {@link ObjectInputStream}. |
661 * Deserializes an {@link MBeanInfo} from an {@link ObjectInputStream}. |
662 * @serialData |
662 * @serialData |
663 * For compatibility reasons, an object of this class is deserialized as follows. |
663 * For compatibility reasons, an object of this class is deserialized as follows. |
664 * <ul> |
664 * <p> |
665 * The method {@link ObjectInputStream#defaultReadObject defaultReadObject()} |
665 * The method {@link ObjectInputStream#defaultReadObject defaultReadObject()} |
666 * is called first to deserialize the object except the field |
666 * is called first to deserialize the object except the field |
667 * {@code descriptor}, which is not serialized in the default way. Then the method |
667 * {@code descriptor}, which is not serialized in the default way. Then the method |
668 * {@link ObjectInputStream#read read()} is called to read a byte, the field |
668 * {@link ObjectInputStream#read read()} is called to read a byte, the field |
669 * {@code descriptor} is deserialized according to the value of the byte value: |
669 * {@code descriptor} is deserialized according to the value of the byte value: |
681 * <li>-1. This means that there is no byte to read and that the object is from |
681 * <li>-1. This means that there is no byte to read and that the object is from |
682 * an earlier version of the JMX API. The field {@code descriptor} is set to |
682 * an earlier version of the JMX API. The field {@code descriptor} is set to |
683 * {@link ImmutableDescriptor#EMPTY_DESCRIPTOR EMPTY_DESCRIPTOR}.</li> |
683 * {@link ImmutableDescriptor#EMPTY_DESCRIPTOR EMPTY_DESCRIPTOR}.</li> |
684 * <li>Any other value. A {@link StreamCorruptedException} is thrown.</li> |
684 * <li>Any other value. A {@link StreamCorruptedException} is thrown.</li> |
685 * </ul> |
685 * </ul> |
686 * </ul> |
686 * |
687 * @since 1.6 |
687 * @since 1.6 |
688 */ |
688 */ |
689 |
689 |
690 private void readObject(ObjectInputStream in) |
690 private void readObject(ObjectInputStream in) |
691 throws IOException, ClassNotFoundException { |
691 throws IOException, ClassNotFoundException { |