public class ApplicationManagerKF
extends java.lang.Object
implements ej.wadapps.application.ApplicationManager, ej.kf.FeatureStateListener
Constructor and Description |
---|
ApplicationManagerKF()
Creates an application manager KF with all the installed features.
|
ApplicationManagerKF(ej.kf.Feature[] features)
Creates an application manager KF with the given features.
|
Modifier and Type | Method and Description |
---|---|
ej.wadapps.application.Application |
addApplication(ej.kf.Feature feature)
Adds an application associated with a feature.
|
void |
addApplicationLifecycleListener(ej.wadapps.application.ApplicationLifecycleListener appLifecycleListener) |
boolean |
contains(ej.kf.Feature feature)
Gets whether a feature is manager by the application manager or not.
|
protected FeatureApplication |
createApplication(ej.kf.Feature feature)
Creates an application from the given feature.
|
ej.wadapps.application.Application |
getApplication(ej.kf.Feature feature)
Gets the application associated with a feature.
|
ej.wadapps.application.Application |
getApplication(ej.kf.Module module)
Gets the application for a module.
|
ej.wadapps.application.Application[] |
getApplications() |
ej.kf.Feature |
getFeature(ej.wadapps.application.Application application)
Gets the feature associated with the application.
|
ej.kf.Feature[] |
getFeatures()
Gets all available features known by this manager.
|
ej.wadapps.application.Application |
removeApplication(ej.kf.Feature feature)
Removes the application associated with a feature.
|
void |
removeApplicationLifecycleListener(ej.wadapps.application.ApplicationLifecycleListener appLifecycleListener) |
void |
stateChanged(ej.kf.Feature feature,
ej.kf.Feature.State previousState) |
public ApplicationManagerKF()
Kernel.getAllLoadedFeatures()
,
ApplicationManagerKF(Feature[])
public ApplicationManagerKF(ej.kf.Feature[] features)
For each feature, an application will be created and available in getApplications()
.
features
- the feature to manage.protected FeatureApplication createApplication(ej.kf.Feature feature)
feature
- the feature to manage@Nullable public ej.wadapps.application.Application getApplication(ej.kf.Feature feature)
feature
- the feature.null
if no application matches the given feature.@Nullable public ej.kf.Feature getFeature(ej.wadapps.application.Application application)
application
- the application.null
if no feature is associated to the given application.public ej.wadapps.application.Application addApplication(ej.kf.Feature feature)
If the feature is already managed by the application manager, nothing changes.
feature
- the feature.@Nullable public ej.wadapps.application.Application removeApplication(ej.kf.Feature feature)
If the feature is not managed by the application manager, nothing changes and null
is returned.
feature
- the feature.null
if not found.public boolean contains(ej.kf.Feature feature)
feature
- the feature.true
if the feature is managed by this application manager, false
otherwise.public ej.kf.Feature[] getFeatures()
If there is none, this method returns an empty array.
@Nullable public ej.wadapps.application.Application getApplication(ej.kf.Module module)
If the given module is the kernel, the method returns null
.
module
- the module.null
.getApplication(Feature)
public ej.wadapps.application.Application[] getApplications()
getApplications
in interface ej.wadapps.application.ApplicationManager
public void addApplicationLifecycleListener(ej.wadapps.application.ApplicationLifecycleListener appLifecycleListener)
addApplicationLifecycleListener
in interface ej.wadapps.application.ApplicationManager
public void removeApplicationLifecycleListener(ej.wadapps.application.ApplicationLifecycleListener appLifecycleListener)
removeApplicationLifecycleListener
in interface ej.wadapps.application.ApplicationManager
public void stateChanged(@Nullable ej.kf.Feature feature, @Nullable ej.kf.Feature.State previousState)
stateChanged
in interface ej.kf.FeatureStateListener