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 destroyingMartiniPackageobject.- Author:
- jerrickpua
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddestroy()MartiniPackageloadPackage(String name, boolean resolveParent)Load a Martini Package.voidstartPackage(String name, boolean resolveParent)Start a Martini PackagevoidstopPackage(String name, boolean resolveChild)Stop a Martini PackagevoidunloadPackage(String name, boolean resolveChild)Unload Martini PackagevoidwritePackageExceptions(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
MartiniPackagethat 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 packagenamebased on therequiredStateprovided in thePackageDependencyof the package- Throws:
io.toro.martini.ipackage.exception.PackageLifeCycleException- if there is a problem in starting the packageio.toro.martini.ipackage.exception.PackageIllegalStateException- if theMartiniPackageis 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()
-
-