Package io.toro.martini.ipackage
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 destroyingMartiniPackage
object.- Author:
- jerrickpua
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
MartiniPackage
loadPackage(String name, boolean resolveParent)
Load a Martini Package.void
startPackage(String name, boolean resolveParent)
Start a Martini Packagevoid
stopPackage(String name, boolean resolveChild)
Stop a Martini Packagevoid
unloadPackage(String name, boolean resolveChild)
Unload Martini Packagevoid
writePackageExceptions(String name, OutputStream stream, io.toro.martini.ipackage.PackageExceptionsWriteMode writeMode)
-
Methods inherited from interface io.toro.martini.ipackage.MartiniPackageProvider
getLoadedPackage, getLoadedPackages, getLoadedPackages, getPackage, getPackages, getPackages
-
-
-
-
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 forresolveParent
- whether to also load the dependencies of the packagename
- Returns:
- the
MartiniPackage
that were constructed by this method - Throws:
io.toro.martini.ipackage.exception.PackageLifeCycleException
- if there is a problem in loading the packageio.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 unloadresolveChild
- whether to also unload the packages that depends on the packagename
- 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 startresolveParent
- whether to also load or start the dependencies of the packagename
based on therequiredState
provided in thePackageDependency
of the package- Throws:
io.toro.martini.ipackage.exception.PackageLifeCycleException
- if there is a problem in starting the packageio.toro.martini.ipackage.exception.PackageIllegalStateException
- if theMartiniPackage
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 StopresolveChild
- whether to also stop the packages that depends on the packagename
- 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()
-
-