public class PersistentApplicationInstallerKF
extends java.lang.Object
The application binary is persisted before the installation, therefore the application binary is available after a reboot.
Modifier and Type | Field and Description |
---|---|
protected ApplicationManagerKF |
applicationManager
the application manager to update when applications are installed or uninstalled
|
protected static java.lang.String |
INSTALL
Install task name
|
protected static java.lang.String |
UNINSTALL
Uninstall task name
|
Constructor and Description |
---|
PersistentApplicationInstallerKF(ApplicationManagerKF applicationManager,
ej.storage.Storage storage)
Creates a persistent application installer on KF.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicationInstallationListener(ej.wadapps.application.ApplicationInstallationListener applicationInstallationListener) |
protected void |
checkPermission(ej.wadapps.application.Application application,
java.lang.String action)
Checks that an action on a application is permitted.
|
ApplicationManagerKF |
getApplicationManager()
Gets the application manager.
|
ej.wadapps.application.Application |
install(java.io.InputStream stream) |
ej.wadapps.application.Application |
install(java.io.InputStream stream,
org.eclipse.core.runtime.IProgressMonitor monitor) |
protected ej.wadapps.application.Application |
installApplication(java.io.InputStream stream,
org.eclipse.core.runtime.IProgressMonitor monitor)
Installs an application from an input stream.
|
protected ej.wadapps.application.Application |
installKF(java.io.InputStream stream,
org.eclipse.core.runtime.IProgressMonitor monitor)
Installs an application into KF.
|
protected void |
notifyInstall(ej.wadapps.application.Application application)
Notifies the listener that an application has been installed.
|
protected void |
notifyUninstall(ej.wadapps.application.Application application)
Notifies the listener that an application has been uninstalled.
|
void |
removeApplicationInstallationListener(ej.wadapps.application.ApplicationInstallationListener applicationInstallationListener) |
void |
stateChanged(ej.kf.Feature feature,
ej.kf.Feature.State previousState) |
boolean |
uninstall(ej.wadapps.application.Application application) |
boolean |
uninstall(ej.wadapps.application.Application application,
org.eclipse.core.runtime.IProgressMonitor monitor) |
protected boolean |
uninstallKF(ej.wadapps.application.Application application,
org.eclipse.core.runtime.IProgressMonitor monitor)
Uninstalls an application from KF.
|
protected static final java.lang.String INSTALL
protected static final java.lang.String UNINSTALL
protected final ApplicationManagerKF applicationManager
public PersistentApplicationInstallerKF(ApplicationManagerKF applicationManager, ej.storage.Storage storage) throws java.io.IOException
If the given storage contains applications, those applications will be installed.
applicationManager
- the applications manager it depends on.storage
- the storage used to persist the application's stream and retrieve applications.java.io.IOException
- If an IO error occurs.public ej.wadapps.application.Application install(java.io.InputStream stream, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.application.ApplicationOperationException
ej.wadapps.application.ApplicationOperationException
protected ej.wadapps.application.Application installApplication(java.io.InputStream stream, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.application.ApplicationOperationException
This method can be overridden in sub classes in order to perform some checks (like verifying a signature, etc).
stream
- the stream containing the application.monitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to
call done() on the given monitor.ej.wadapps.application.ApplicationOperationException
- if any unexpected errors occur while installing this application.public boolean uninstall(ej.wadapps.application.Application application, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.application.ApplicationOperationException
ej.wadapps.application.ApplicationOperationException
public ApplicationManagerKF getApplicationManager()
public ej.wadapps.application.Application install(java.io.InputStream stream) throws ej.wadapps.application.ApplicationOperationException
install
in interface ej.wadapps.application.ApplicationInstaller
ej.wadapps.application.ApplicationOperationException
protected ej.wadapps.application.Application installKF(java.io.InputStream stream, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.application.ApplicationOperationException
stream
- the stream containing the application.monitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to
call done() on the given monitor.ej.wadapps.application.ApplicationOperationException
- if any unexpected errors occur while installing this application.public boolean uninstall(ej.wadapps.application.Application application) throws ej.wadapps.application.ApplicationOperationException
uninstall
in interface ej.wadapps.application.ApplicationInstaller
ej.wadapps.application.ApplicationOperationException
protected boolean uninstallKF(ej.wadapps.application.Application application, org.eclipse.core.runtime.IProgressMonitor monitor) throws ej.wadapps.application.ApplicationOperationException
application
- the application to uninstall.monitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to
call done() on the given monitor.true
if the application has been uninstalled, false
otherwise.ej.wadapps.application.ApplicationOperationException
- if any unexpected errors occur while uninstalling this application.public void addApplicationInstallationListener(ej.wadapps.application.ApplicationInstallationListener applicationInstallationListener)
addApplicationInstallationListener
in interface ej.wadapps.application.ApplicationInstaller
public void removeApplicationInstallationListener(ej.wadapps.application.ApplicationInstallationListener applicationInstallationListener)
removeApplicationInstallationListener
in interface ej.wadapps.application.ApplicationInstaller
public void stateChanged(@Nullable ej.kf.Feature feature, @Nullable ej.kf.Feature.State previousState)
stateChanged
in interface ej.kf.FeatureStateListener
protected void notifyInstall(ej.wadapps.application.Application application)
application
- the installed application.protected void notifyUninstall(ej.wadapps.application.Application application)
application
- the uninstalled application.protected void checkPermission(@Nullable ej.wadapps.application.Application application, java.lang.String action)
application
- the application.action
- the action.