public interface Application
Two applications are equals if and only if they have the same identifier.
Modifier and Type | Interface and Description |
---|---|
static class |
Application.State
Represents an application state.
|
Modifier and Type | Method and Description |
---|---|
String |
getIdentifier()
Gets the application identifier.
|
String |
getProperty(String key)
Gets an application property.
|
InputStream |
getResourceAsStream(String name)
Gets an input stream for reading the specified resource from the application.
|
Application.State |
getState()
Returns the current application state.
|
String |
getVersion()
Gets the application version.
|
void |
install()
Deprecated.
|
void |
install(IProgressMonitor monitor)
Deprecated.
|
void |
start()
Causes this application to start.
|
void |
start(IProgressMonitor monitor)
Causes this application to start.
|
void |
stop()
Causes this application to stop.
|
void |
uninstall()
Causes the application to be uninstalled.
|
String getIdentifier()
The identifier remains the same even between different application version.
String getProperty(String key) throws IllegalStateException
key
- the property key to search.null
if not existing.IllegalStateException
- if the application state is not Application.State.STARTED
state.InputStream getResourceAsStream(String name) throws IllegalStateException
name
- the resource name.null
if the
resource could not be found.IllegalStateException
- if the application state is not Application.State.STARTED
state.Application.State getState()
Application.State
String getVersion()
@Deprecated void install() throws IllegalStateException, SecurityException, ApplicationOperationException
IllegalStateException
- if the application state is not Application.State.UNINSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while installing this application.@Deprecated void install(IProgressMonitor monitor) throws IllegalStateException, SecurityException, ApplicationOperationException
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.IllegalStateException
- if the application state is not Application.State.UNINSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while installing this application.void start() throws IllegalStateException, SecurityException, ApplicationOperationException
Application.State.STARTED
state and this method returns.IllegalStateException
- if the application state is not Application.State.INSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while starting this application.void start(IProgressMonitor monitor) throws IllegalStateException, SecurityException, ApplicationOperationException
Application.State.STARTED
state and this method returns.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.IllegalStateException
- if the application state is not Application.State.INSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while starting this application.void stop() throws IllegalStateException, SecurityException, ApplicationOperationException
Application.State.INSTALLED
state and this method returns.IllegalStateException
- if the application is in the Application.State.INSTALLED
or
Application.State.UNINSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while stopping this application.void uninstall() throws IllegalStateException, SecurityException, ApplicationOperationException
IllegalStateException
- if the application is not in the Application.State.INSTALLED
state.SecurityException
- if a security manager exits and if the caller does not have the
appropriate permissions.ApplicationOperationException
- If any unexpected errors occur while uninstalling this
application.