public interface ApplicationsManager
It allows:
Modifier and Type | Method and Description |
---|---|
void |
addApplicationLifecycleListener(ApplicationLifecycleListener applicationLifecycleListener)
Adds an application lifecycle listener.
|
void |
execute(java.io.InputStream commandInputStream)
Decodes and executes an application management command.
|
void |
execute(java.io.InputStream commandInputStream,
IProgressMonitor monitor)
Decodes and executes an application management command.
|
Application |
getApplication(java.lang.Object object)
Gets the application that owns the given object.
|
Application |
getCurrentApplication()
Gets the context application.
|
Application[] |
getInstalledApplications()
Gets all installed applications.
|
Application |
install(java.io.InputStream inputStream,
java.lang.String applicationIdentifier,
java.lang.String applicationVersion)
Installs an application from the given input stream.
|
void |
removeApplicationLifecycleListener(ApplicationLifecycleListener applicationLifecycleListener)
Removes an application lifecycle listener.
|
void execute(java.io.InputStream commandInputStream) throws java.io.IOException, ApplicationOperationException, java.lang.UnsupportedOperationException, java.lang.SecurityException
The format of the command binary form is not specified here and depend on the implementation.
For example, the command could be digitally signed and encoded using Distinguished Encoding Rules, a.k.a DER, (see ASN.1).
commandInputStream
- the encoded command input stream.java.io.IOException
- if an I/O error occurs.ApplicationOperationException
- if an error occurs while executing the command.java.lang.UnsupportedOperationException
- if the applications manager does not support the operation.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.void execute(java.io.InputStream commandInputStream, IProgressMonitor monitor) throws java.io.IOException, ApplicationOperationException, java.lang.UnsupportedOperationException, java.lang.SecurityException
The format of the command binary form is not specified here and depend on the implementation.
For example, the command could be digitally signed and encoded using Distinguished Encoding Rules, a.k.a DER, (see ASN.1).
commandInputStream
- the encoded command input stream.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. Accepts null
, indicating that no progress should be
reported and that the operation cannot be cancelled.java.io.IOException
- if an I/O error occurs.ApplicationOperationException
- if an error occurs while executing the command.java.lang.UnsupportedOperationException
- if the applications manager does not support the operation.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.Application install(java.io.InputStream inputStream, java.lang.String applicationIdentifier, java.lang.String applicationVersion) throws java.io.IOException, ApplicationOperationException, java.lang.UnsupportedOperationException, java.lang.SecurityException
inputStream
- the input stream from where the application data is loaded.applicationIdentifier
- the application identifier.applicationVersion
- the application version.java.io.IOException
- if an I/O error occurs.ApplicationOperationException
- if an error occurs during the installation or if unsigned applications are not authorized.java.lang.UnsupportedOperationException
- if the applications manager cannot install applications.java.lang.SecurityException
- if a security manager exits and if the caller does not have the appropriate permissions.void addApplicationLifecycleListener(ApplicationLifecycleListener applicationLifecycleListener) throws java.lang.NullPointerException
It will be notified for each application event: install, start, stop, uninstall.
applicationLifecycleListener
- the listener to add.java.lang.NullPointerException
- if the given listener is null
.void removeApplicationLifecycleListener(ApplicationLifecycleListener applicationLifecycleListener)
If the given listener is null
or not registered, nothing is done.
applicationLifecycleListener
- the listener to remove.Application[] getInstalledApplications()
If there is not installed applications, this method returns an empty array.
Application getCurrentApplication()
Application getApplication(java.lang.Object object)
object
- the object.