Interface PackageManager

  • All Superinterfaces:
    MartiniPackageProvider

    public interface PackageManager
    extends MartiniPackageProvider
    Manager class that handles in the Life cycle of a Martini Package This is the entry point of start, stop, unload, and load operation of a Martini Package. This class is responsible in creating and destroying MartiniPackage object.
    Author:
    jerrickpua
    • Method Detail

      • loadPackage

        MartiniPackage loadPackage​(String name,
                                   boolean resolveParent)
                            throws io.toro.martini.ipackage.exception.PackageLifeCycleException,
                                   io.toro.martini.ipackage.exception.PackageNotFoundException
        Load a Martini Package.
        Parameters:
        name - the name of the Package to search for
        resolveParent - whether to also load the dependencies of the package name
        Returns:
        the MartiniPackage that were constructed by this method
        Throws:
        io.toro.martini.ipackage.exception.PackageLifeCycleException - if there is a problem in loading the package
        io.toro.martini.ipackage.exception.PackageNotFoundException - if there is no Package by the supplied name
      • unloadPackage

        void unloadPackage​(String name,
                           boolean resolveChild)
                    throws io.toro.martini.ipackage.exception.PackageLifeCycleException
        Unload Martini Package
        Parameters:
        name - the package to unload
        resolveChild - whether to also unload the packages that depends on the package name
        Throws:
        io.toro.martini.ipackage.exception.PackageLifeCycleException - if there is a problem in unloading the package
      • startPackage

        void startPackage​(String name,
                          boolean resolveParent)
                   throws io.toro.martini.ipackage.exception.PackageLifeCycleException
        Start a Martini Package
        Parameters:
        name - the package to start
        resolveParent - whether to also load or start the dependencies of the package name based on the requiredState provided in the PackageDependency of the package
        Throws:
        io.toro.martini.ipackage.exception.PackageLifeCycleException - if there is a problem in starting the package
        io.toro.martini.ipackage.exception.PackageIllegalStateException - if the MartiniPackage is not loaded.
      • stopPackage

        void stopPackage​(String name,
                         boolean resolveChild)
                  throws io.toro.martini.ipackage.exception.PackageLifeCycleException
        Stop a Martini Package
        Parameters:
        name - the package to Stop
        resolveChild - whether to also stop the packages that depends on the package name
        Throws:
        io.toro.martini.ipackage.exception.PackageLifeCycleException - if there is a problem in stop the package
      • writePackageExceptions

        void writePackageExceptions​(String name,
                                    OutputStream stream,
                                    io.toro.martini.ipackage.PackageExceptionsWriteMode writeMode)
      • destroy

        void destroy()