Interface AtomosLayer

    • Method Detail

      • adapt

        <T> Optional<T> adapt​(Class<T> type)
        Adapt this Atomos layer to the specified type. For example, if running in a module layer then the layer can be adapted to a ModuleLayer associated with this Atomos Layer.
        Type Parameters:
        T - The type to which this Atomos layer is to be adapted.
        Parameters:
        type - Class object for the type to which this Atomos layer is to be adapted.
        Returns:
        The object, of the specified type, to which this Atomos layer has been adapted or empty if this layer cannot be adapted to the specified type.
      • addModules

        AtomosLayer addModules​(String name,
                               Path path)
        A convenience method that adds the modules found at the specified path to a new child layer of this layer.
        Parameters:
        name - The name of the layer.
        path - The path to the modules. If null then the default will try to determine the location on disk of the atomos runtime module and look for a folder with the same name as the specified name of the layer.
        Returns:
        a newly created layer
        Throws:
        UnsupportedOperationException - if isAddLayerSupported() returns false.
      • isAddLayerSupported

        boolean isAddLayerSupported()
        Returns true if additional layers are supported.
        Returns:
        if modules and additional layers are supported.
      • getChildren

        Set<AtomosLayer> getChildren()
        The Atomos Layer children of this layer
        Returns:
        The children of this layer
      • getParents

        List<AtomosLayer> getParents()
        The Atomos parents of this layer
        Returns:
        the parnets of this layer
      • getAtomosContents

        Set<AtomosContent> getAtomosContents()
        The Atomos contents contained in this layer
        Returns:
        the Atomos contents
      • findAtomosContent

        Optional<AtomosContent> findAtomosContent​(String symbolicName)
        Returns the Atomos content with the given name in this layer, or if not in this layer, the parent layers. Finding content in parent layers is equivalent to invoking findAtomosContent on each parent, in search order, until the content is found or all parents have been searched. In a tree of layers then this is equivalent to a depth-first search.
        Parameters:
        symbolicName - the name of the content to find
        Returns:
        The content with the given name or an empty Optional if there isn't a content with this name in this layer or any parent layer
      • getName

        String getName()
        The name of the Atomos Layer. By default the Atomos Layer name is the empty string. Atomos Layer names are not required to be unique. All Atomos contents contained in a layer will have locations that use the layer name as a prefix. If the layer name is not the empty string then the location prefix will be the layer name followed by a colon (:). This allows two different layers to load the same content in different layers.
        Returns:
        the name of the layer
      • getId

        long getId()
        Returns this Atomos Layer's unique identifier. This Atomos Layer is assigned a unique identifier when it was installed in the Atomos runtime.

        A Atomos Layer's unique identifier has the following attributes:

        • Is unique and persistent.
        • Is a long.
        • Its value is not reused for another layer, even after a layer is uninstalled.
        • Does not change while a layer remains installed.
        Returns:
        The unique identifier of this layer.
      • getLoaderType

        AtomosLayer.LoaderType getLoaderType()
        Returns the loader type used for this Atomos layer.
        Returns:
        the loader type
      • uninstall

        void uninstall()
                throws BundleException
        Uninstalls this Atomos Layer along with any children layers.
        Throws:
        BundleException - If an error happened while uninstalling any connected bundles in the layer