Class ZipSerializableViewImpl

  • All Implemented Interfaces:
    java.io.Serializable, Assignable, SerializableView, ZipSerializableView

    public class ZipSerializableViewImpl
    extends java.lang.Object
    implements ZipSerializableView
    Implementation of a Serializable view of Archives, backed by ZIP en/decoding the contents during serialization/deserialization. Defines the wire protocol and must remain backwards-compatible.
    Version:
    $Revision: $
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Archive<?> archive
      Underlying archive.
      private java.lang.String id
      String form of the ID
      private static java.util.logging.Logger log
      Logger
      private java.lang.String name
      Name of the archive; to be serialized
      private static long serialVersionUID
      serialVersionUID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <TYPE extends Assignable>
      TYPE
      as​(java.lang.Class<TYPE> clazz)
      Wraps an Archive in a different 'view'.
      private void readObject​(java.io.ObjectInputStream in)
      Deserializes according to the custom form defined by ZipSerializableImpl#writeObject(ObjectOutputStream)
      private void writeObject​(java.io.ObjectOutputStream out)
      Serializes the invocation with a custom form
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        serialVersionUID
        See Also:
        Constant Field Values
      • log

        private static final java.util.logging.Logger log
        Logger
      • name

        private final java.lang.String name
        Name of the archive; to be serialized
      • id

        private transient java.lang.String id
        String form of the ID
      • archive

        private transient Archive<?> archive
        Underlying archive. Won't be directly serialized; instead we'll encode it as ZIP and send that
    • Constructor Detail

      • ZipSerializableViewImpl

        public ZipSerializableViewImpl​(Archive<?> archive)
        Creates a new instance, wrapping the specified Archive
    • Method Detail

      • as

        public <TYPE extends Assignable> TYPE as​(java.lang.Class<TYPE> clazz)
        Wraps an Archive in a different 'view'.
        Specified by:
        as in interface Assignable
        Parameters:
        clazz - Extension interface to load
        Returns:
        The Archive wrapped as TYPE
        See Also:
        Assignable.as(java.lang.Class)
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream out)
                          throws java.io.IOException
        Serializes the invocation with a custom form
        Throws:
        java.io.IOException
      • readObject

        private void readObject​(java.io.ObjectInputStream in)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Deserializes according to the custom form defined by ZipSerializableImpl#writeObject(ObjectOutputStream)
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException