Class BundleArchiveRevision


  • public abstract class BundleArchiveRevision
    extends java.lang.Object

    This class implements an abstract revision of a bundle archive. A revision is an abstraction of a bundle's actual content and is associated with a parent bundle archive. A bundle archive may have multiple revisions assocaited with it at one time, since updating a bundle results in a new version of the bundle's content until the bundle is refreshed. Upon a refresh, then old revisions are then purged. This abstract class is the base class for all concrete types of revisions, such as ones for a JAR file or directories. All revisions are assigned a root directory into which all of their state should be stored, if necessary. Clean up of this directory is the responsibility of the parent bundle archive and not of the revision itself.

    See Also:
    BundleCache, BundleArchive
    • Constructor Summary

      Constructors 
      Constructor Description
      BundleArchiveRevision​(Logger logger, java.util.Map configMap, java.io.File revisionRootDir, java.lang.String location)
      This class is abstract and cannot be created.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void close()
      This method is called when the revision is no longer needed.
      java.util.Map getConfig()
      Returns the configuration map for this revision.
      abstract Content getContent()  
      java.lang.String getLocation()
      Returns the location string this revision.
      Logger getLogger()
      Returns the logger for this revision.
      abstract java.util.Map getManifestHeader()
      Returns the main attributes of the JAR file manifest header of the revision.
      java.io.File getRevisionRootDir()
      Returns the root directory for this revision.
      • Methods inherited from class java.lang.Object

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

      • BundleArchiveRevision

        public BundleArchiveRevision​(Logger logger,
                                     java.util.Map configMap,
                                     java.io.File revisionRootDir,
                                     java.lang.String location)
                              throws java.lang.Exception

        This class is abstract and cannot be created. It represents a revision of a bundle, i.e., its content. A revision is associated with a particular location string, which is typically in URL format. Subclasses of this class provide particular functionality, such as a revision in the form of a JAR file or a directory. Each revision subclass is expected to use the root directory associated with the abstract revision instance to store any state; this will ensure that resources used by the revision are properly freed when the revision is no longer needed.

        Parameters:
        logger - a logger for use by the revision.
        revisionRootDir - the root directory to be used by the revision subclass for storing any state.
        location - the location string associated with the revision.
        trustedCaCerts - the trusted CA certificates if any.
        Throws:
        java.lang.Exception - if any errors occur.
    • Method Detail

      • getLogger

        public Logger getLogger()

        Returns the logger for this revision.

        Returns:
        the logger instance for this revision.
      • getConfig

        public java.util.Map getConfig()

        Returns the configuration map for this revision.

        Returns:
        the configuration map for this revision.
      • getRevisionRootDir

        public java.io.File getRevisionRootDir()

        Returns the root directory for this revision.

        Returns:
        the root directory for this revision.
      • getLocation

        public java.lang.String getLocation()

        Returns the location string this revision.

        Returns:
        the location string for this revision.
      • getManifestHeader

        public abstract java.util.Map getManifestHeader()
                                                 throws java.lang.Exception

        Returns the main attributes of the JAR file manifest header of the revision. The returned map is case insensitive.

        Returns:
        the case-insensitive JAR file manifest header of the revision.
        Throws:
        java.lang.Exception - if any error occurs.
      • getContent

        public abstract Content getContent()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        protected abstract void close()
                               throws java.lang.Exception

        This method is called when the revision is no longer needed. The directory associated with the revision will automatically be removed for each revision, so this method only needs to be concerned with other issues, such as open files.

        Throws:
        java.lang.Exception - if any error occurs.