Class AppService
- Since:
- 1
- Version:
- 9
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintgetApiVersion(String appId) Return the api version for the specified appId.getApps()Return the list of discovered applications in the manifest.Return the list of auto-started applications from the manifest.Return aReadyIndicatorthat is ready once all autostart applications are started.List<Application<?>>Return the list of all applications that have already been started.booleanisAppAutostart(String appId) Return true if the specified appId is in an autostart section.booleanisAppInstalled(String appId) Return true if the specified appId is installed as part of the running manifest.loadApp(KabFile kab, Application<?> parent) Attempts to load the specified application.loadApp(KabFile kab, Application<?> parent, Collection<Object> beans) Attempts to load the specified application.voidUnloads the application associated with the given loader.voidwhenAppStarted(String appId, AppStartedCallback callback) Call the specified callback when the requested appId is started.
-
Field Details
-
SYSTEM_SECTION
- See Also:
-
SECTION_PREFIX_AUTOSTART
- See Also:
-
SYSTEM_CONFIG_FILE
- See Also:
-
SYSTEM_APP_ID
- See Also:
-
-
Method Details
-
loadApp
Attempts to load the specified application. The specified KAB must contain a properly formedkos.appsection in the descriptor. Typically applications are packaged in kabs of type "kos.app" but this is not required unless they are part of thekos.autostart.*section.If a parent application is specified, the new application class loader and bean context will use the parent application class loader and bean context as parents. This allows the new application to access classes and beans from the parent application.
The resulting loader can be used to start the app by calling
loader.start(). This allows the application context to be modified before the application is started, which is an effective way to pass data to an application.- Parameters:
kab- the application KABparent- optional parent application- Returns:
AppLoaderused to start the app- Since:
- 1
-
loadApp
Attempts to load the specified application. The specified KAB must contain a properly formedkos.appsection in the descriptor. Typically applications are packaged in kabs of type "kos.app" but this is not required unless they are part of thekos.autostart.*section.If a parent application is specified, the new application class loader and bean context will use the parent application class loader and bean context as parents. This allows the new application to access classes and beans from the parent application.
The resulting loader can be used to start the app by calling
loader.start(). This allows the application context to be modified before the application is started, which is an effective way to pass data to an application.This allows a collection of beans to be specified. These beans will be added to the
BeanContextof the application before it is configured. This allows passing beans to a an application and by autowiring them within the application.- Parameters:
kab- the application KABparent- optional parent applicationbeans- optional connection of beans to add to the app context- Returns:
AppLoaderused to start the app- Since:
- 1
-
unloadApp
Unloads the application associated with the given loader.- Parameters:
loader- the loader to unload- Since:
- 1
-
getAutostartAppsReady
Return aReadyIndicatorthat is ready once all autostart applications are started.- Since:
- 8
-
getAutostartApps
Return the list of auto-started applications from the manifest. These are defined in sections with a"kos.autostart."prefix.- Since:
- 8
-
getApps
Return the list of discovered applications in the manifest. These includes every kab of typekos.app, regardless of the section they are in.- Since:
- 8
-
getStartedApps
Return the list of all applications that have already been started. This only includes application that have been loaded and started, and not stopped.- Since:
- 8
-
whenAppStarted
Call the specified callback when the requested appId is started. If already started, this will be called immediately. This will only be called once. If the application unloads and reloads it will not be called again. This is a convenience method which is a simple alternative to implementingAppListener.- Since:
- 6
-
isAppInstalled
Return true if the specified appId is installed as part of the running manifest.- Since:
- 9
-
isAppAutostart
Return true if the specified appId is in an autostart section.- Since:
- 9
-
getApiVersion
Return the api version for the specified appId. Returns -1 if the app is not installed.- Parameters:
appId- the id of the app- Since:
- 9
-