This is the part of the interface to the Application Service that is not public.
import "IApplicationService.idl";
Public Member Functions | |
void | RegisterObserverInternal (in string address, out TObserverId observerId) raises (TToiInvalidArgumentException) |
void | ReleaseObserverInternal (in string address) raises (TToiInvalidArgumentException) |
void | ReportInstanceFailure (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | StartInstance (in TToiApplicationId applicationId, in TObserverId observerId) raises (TToiInvalidArgumentException) |
void | ReleaseInstance (in TToiApplicationId applicationId, in TObserverId observerId) raises (TToiInvalidArgumentException) |
void | SetEnvironment (in string name, in string value) raises (TToiInvalidArgumentException) |
void | GetApplicationPid (in TToiApplicationId applicationId, out long pid) raises (TToiInvalidArgumentException) |
void | RegisterFactoryResetHandler (in TToiApplicationId applicationId, in string address) raises (TToiInvalidArgumentException) |
void | FactoryResetHandlerDone (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | RegisterApplication (in string propertyFilename) raises (TToiInvalidArgumentException) |
void | ReportStarted (in TToiApplicationId applicationId, in string address) raises (TToiInvalidArgumentException) |
void | ReportPing (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | Activate (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | ActivateWithUri (in TToiApplicationId applicationId, in string uri, in string mimeType) raises (TToiInvalidArgumentException) |
void | ActivateWithCommand (in TToiApplicationId applicationId, in string command) raises (TToiInvalidArgumentException) |
void | Deactivate (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | Kill (in TToiApplicationId applicationId) raises (TToiInvalidArgumentException) |
void | GetOwnApplicationId (out TToiApplicationId applicationId) |
void | GetApplicationIds (out TToiApplicationIdSequence applicationIds) |
void | GetBoolProperty (in TToiApplicationId applicationId, in string property, out boolean value) raises (TToiInvalidArgumentException) |
void | GetIntProperty (in TToiApplicationId applicationId, in string property, out long value) raises (TToiInvalidArgumentException) |
void | GetStringProperty (in TToiApplicationId applicationId, in string property, out string value) raises (TToiInvalidArgumentException) |
void | GetStringSequenceProperty (in TToiApplicationId applicationId, in string property, out TToiPropertyStringSequence values) raises (TToiInvalidArgumentException) |
void | GetInfo (in TToiApplicationId applicationId, out TToiApplicationInfo info) raises (TToiInvalidArgumentException) |
void | LoadUri (in string uri, in string mimeType) raises (TToiUnhandledValueException) |
void | RegisterObserver (in IToiApplicationService::TToiApplicationId applicationId, in string address) raises (TToiInvalidArgumentException) |
void | ReleaseObserver (in string address) raises (TToiInvalidArgumentException) |
Public Types | |
typedef unsigned long | TObserverId |
enum | TToiApplicationState { STATE_REGISTERED, STATE_INSTALLING, STATE_INSTALLED, STATE_STARTING, STATE_INVISIBLE, STATE_VISIBLE, STATE_ACTIVE, STATE_STOPPED } |
typedef long | TToiApplicationId |
typedef sequence < TToiApplicationId > | TToiApplicationIdSequence |
typedef sequence < TToiApplicationInfo > | TToiApplicationInfoSequence |
typedef sequence< string > | TToiPropertyStringSequence |
typedef unsigned long IApplicationService::TObserverId |
The observer identifier.
typedef long IToiApplicationService::TToiApplicationId [inherited] |
The application identifier type.
typedef sequence< TToiApplicationId > IToiApplicationService::TToiApplicationIdSequence [inherited] |
A sequence of application identifiers.
typedef sequence< TToiApplicationInfo > IToiApplicationService::TToiApplicationInfoSequence [inherited] |
A sequence of application info structure.
typedef sequence< string > IToiApplicationService::TToiPropertyStringSequence [inherited] |
A sequence of property string values.
enum IToiApplicationService::TToiApplicationState [inherited] |
The TToiApplicationState datatype enumerates the different states an application can be in. The application process (or processes) may exist in the system only when in STATE_STARTING, STATE_INVISIBLE, STATE_VISIBLE or STATE_ACTIVE states. This means that it is guaranteed that the application has exited before it enters STATE_STOPPED.
STATE_REGISTERED |
In STATE_REGISTERED, the application exists only as a simple registration entry containing the basic application properties. |
STATE_INSTALLING |
In STATE_INSTALLING, the application's installation package and packages needed by the installation package are being installed. The application enters this state from STATE_REGISTERED. If the installation was successful the application enters STATE_INSTALLED. If the installation failed the application enters STATE_REGISTERED again. |
STATE_INSTALLED |
In the STATE_INSTALLED state, the application is installed on the system, ready to be started. The application may enter this state from STATE_INSTALLING or STATE_STOPPED. The application leaves this state either by being started (entering STATE_STARTING) or by being uninstalled (entering STATE_REGISTERED). |
STATE_STARTING |
During STATE_STARTING, the application will be started and it will initialize itself to become fully operational. The application leaves this state for one of the running states by registering with the Application Service, using the IToiApplicationService::ReportStarted() method. Which one of the running states STATE_INVISIBLE, STATE_VISIBLE, or STATE_ACTIVE, it enters basically depends on the states of other applications running on the system. If the application fails to register with the Application Service within a configurable time, the application will be stopped. |
STATE_INVISIBLE |
In STATE_INVISIBLE, the application is running but it is not visible to the user. In this state the application should preserve computing resources by not doing anything that has the sole purpose of producing output to the screen. |
STATE_VISIBLE |
In STATE_VISIBLE, the application is running and some parts, but not all, of it is visible to the user. |
STATE_ACTIVE |
In STATE_ACTIVE, the application is running and is the frontmost one visible to the user and receiving all user input. |
STATE_STOPPED |
In STATE_STOPPED, the application process (or processes) does no longer exist in the system. The application may get to this state either by exiting in an orderly fashion, crashing, misbehaving in such a way that the Application Service decides to stop it. When the platform has released all resources and there are no references left to the application instance the application will leave STATE_STOPPED. Depending on if the application is configured to restart automatically or not, or if the application should be uninstalled, it will enter STATE_STARTING or STATE_INSTALLED. |
void IToiApplicationService::Activate | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) [inherited] |
This method changes the state of the given application to STATE_ACTIVE. The currently active application will become visible or invisible and if there is an application that is visible it might become invisible.
applicationId | The identifier of the application to make active. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::ActivateWithCommand | ( | in TToiApplicationId | applicationId, | |
in string | command | |||
) | raises (TToiInvalidArgumentException) [inherited] |
This method does the same thing as Activate() but it also tells the newly activated application to execute a command.
applicationId | The identifier of the application to make active. | |
command | The command the application shall execute. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::ActivateWithUri | ( | in TToiApplicationId | applicationId, | |
in string | uri, | |||
in string | mimeType | |||
) | raises (TToiInvalidArgumentException) [inherited] |
This method does the same thing as Activate() but it also tells the newly activated application to load a specific URI.
applicationId | The identifier of the application to make active. | |
uri | The URI that the application shall load. | |
mimeType | The MIME type of the uri if known, otherwise empty. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::Deactivate | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) [inherited] |
This method changes the state of the given application to STATE_INVISIBLE IF it can be determined which application should become active. If it cannot be determined which application should become active, Deactivate() does not change state of any application.
Use this method to make popup applications disappear.
applicationId | The identifier of the application to deactivate. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IApplicationService::FactoryResetHandlerDone | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) |
An application must call this method after having received a IFactoryResetHandler::PerformFactoryReset callback and completed the requested reset to report that it has done its part of the factory reset.
applicationId | The id of the application. |
TToiInvalidArgumentException | Raised if the applicationId is invalid. |
void IToiApplicationService::GetApplicationIds | ( | out TToiApplicationIdSequence | applicationIds | ) | [inherited] |
Returns the identifiers for all registered applications.
applicationsIds | The identifiers of all registered applications. |
void IApplicationService::GetApplicationPid | ( | in TToiApplicationId | applicationId, | |
out long | pid | |||
) | raises (TToiInvalidArgumentException) |
Get the pid from applicationId
applicationId | The id of the application. | |
pid | The process id of the application. If there is some error happened, such as the application is not loaded, pid will be set to -1. |
TToiInvalidArgumentException | Raised if the applicationId is invalid. |
void IToiApplicationService::GetBoolProperty | ( | in TToiApplicationId | applicationId, | |
in string | property, | |||
out boolean | value | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Returns the value of a boolean property for an application.
applicationId | The identifier of the application to get a property for. | |
property | The name of the property. |
value | The returned property value. |
TToiInvalidArgumentException | Raised if a parameter is invalid. |
void IToiApplicationService::GetInfo | ( | in TToiApplicationId | applicationId, | |
out TToiApplicationInfo | info | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Returns information about the application.
applicationId | The identifier of the application to get a property for. |
info | The returned information struct. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::GetIntProperty | ( | in TToiApplicationId | applicationId, | |
in string | property, | |||
out long | value | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Returns the value of an integer property for an application.
applicationId | The identifier of the application to get a property for. | |
property | The name of the property. |
value | The returned property value. |
TToiInvalidArgumentException | Raised if a parameter is invalid. |
void IToiApplicationService::GetOwnApplicationId | ( | out TToiApplicationId | applicationId | ) | [inherited] |
Returns the calling application's identifier. This function is mainly intended for Javascript since the identifier is also available in the APPLICATION_ID environment variable.
applicationId | The identifier of the calling application. |
void IToiApplicationService::GetStringProperty | ( | in TToiApplicationId | applicationId, | |
in string | property, | |||
out string | value | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Returns the value of a string property for an application.
applicationId | The identifier of the application to get a property for. | |
property | The name of the property. |
value | The returned property value. |
TToiInvalidArgumentException | Raised if a parameter is invalid. |
void IToiApplicationService::GetStringSequenceProperty | ( | in TToiApplicationId | applicationId, | |
in string | property, | |||
out TToiPropertyStringSequence | values | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Returns the values of a sequence property for an application. Unlike the other property functions it does not throw an exception if the property does not exist, instead it returns an empty sequence.
applicationId | The identifier of the application to get a property for. | |
property | The name of the property. |
values | The returned property values. |
TToiInvalidArgumentException | Raised if a parameter is invalid. |
void IToiApplicationService::Kill | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) [inherited] |
Kill an application. This method has no effect if the application is not currently running. If the application is running it will be restarted automatically if the restart property is true. This method is useful in forcing an application to a known initial state.
applicationId | The identifier of the application to kill. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::LoadUri | ( | in string | uri, | |
in string | mimeType | |||
) | raises (TToiUnhandledValueException) [inherited] |
Call this method to tell the Application Service to load a specific URI. If an application is registered to handle the type of URI, it will be activated and IToiApplication::LoadUri() will be called.
uri | The URI to load. | |
mimeType | The MIME type is used to hint the loader about which application to use for loading the URI. |
TToiUnhandledValueException | Raised if there is no application that handles the URI or the MIME type. |
void IToiApplicationService::RegisterApplication | ( | in string | propertyFilename | ) | raises (TToiInvalidArgumentException) [inherited] |
This method can be called to register new applications.
This is used to dynamically register new applications at runtime.
The applications registered at runtime will automatically be considered to be dynamically downloadable uninstallable applications. In consequence they have to be downloaded and installed before they are started.
propertyFilename | The name of the property file of the application. |
TToiInvalidArgumentException | Raised when the supplied propertyFilename or property file is invalid. |
void IApplicationService::RegisterFactoryResetHandler | ( | in TToiApplicationId | applicationId, | |
in string | address | |||
) | raises (TToiInvalidArgumentException) |
An application can register an IFactoryResetHandler callback interface that will be called when IToiPlatformService::FactoryReset is called.
When the application has done the requested factory reset it must call FactoryResetHandlerDone.
applicationId | The id of the application. | |
address | The address to the IFactoryResetHandler callback interface implemented by the application. |
TToiInvalidArgumentException | Raised if the applicationId is invalid. |
void IToiApplicationService::RegisterObserver | ( | in IToiApplicationService::TToiApplicationId | applicationId, | |
in string | address | |||
) | raises (TToiInvalidArgumentException) [inherited] |
Register an observer of type IToiApplicationObserver. The observer will receive events sent by this IToiApplicationService instance.
applicationId | The identifier of the observing application. | |
address | The address where the IToiApplicationService can find an IToiApplicationObserver interface. |
TToiInvalidArgumentException | Raised if the specified address is invalid or if the application has already registered itself as an observer with the same address. |
void IApplicationService::RegisterObserverInternal | ( | in string | address, | |
out TObserverId | observerId | |||
) | raises (TToiInvalidArgumentException) |
Internal observers can call this method to register themselves to get informed about all application state changes.
When registered the observer will get an initial callback with the current state of all applications registered in the system.
address | The address to an observer implementing the IToiApplicationObserver interface. |
observerId | The identifier that should be used when calling StartInstance() and ReleaseInstance(). |
TToiInvalidArgumentException | Raised if the specified address is invalid or if an observer has already registered itself with the same address. |
void IApplicationService::ReleaseInstance | ( | in TToiApplicationId | applicationId, | |
in TObserverId | observerId | |||
) | raises (TToiInvalidArgumentException) |
This function should be called when an application has changed state to STATE_STOPPED. It should be called by all (and only) platform services that have registered as observers with RegisterObserverInternal. It should be called as soon as the resources associated with the application has been released. When this function has been called the service must be prepared for the application to restart.
The function must be called exactly once by each registered service after the service received an event that an application has entered STATE_STOPPED.
applicationId | The id of the application. | |
applicationId | The identifier of the application. | |
observerId | The identifier of the registered observer. |
TToiInvalidArgumentException | Raised when the supplied application identifier is invalid. |
void IToiApplicationService::ReleaseObserver | ( | in string | address | ) | raises (TToiInvalidArgumentException) [inherited] |
Release an observer previously registered with RegisterObserver.
address | The address where the IToiApplicationService can find the registered IToiApplicationObserver interface. |
TToiInvalidArgumentException | Raised if the specified address is invalid. |
void IApplicationService::ReleaseObserverInternal | ( | in string | address | ) | raises (TToiInvalidArgumentException) |
Internal observers can call this method to release themselves as observers.
address | The address to the observer implementing the IToiApplicationObserver interface. |
TToiInvalidArgumentException | Raised if the specified address is not registered. |
void IApplicationService::ReportInstanceFailure | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) |
This function is used to tell the Application Service that an application has failed.
applicationId | The id of the application. |
TToiInvalidArgumentException | Raised when the supplied application id is invalid. |
void IToiApplicationService::ReportPing | ( | in TToiApplicationId | applicationId | ) | raises (TToiInvalidArgumentException) [inherited] |
This method must be called by applications that receive a Ping from the Application Service. If the application does not do so within the time configured in the application properties, it will be terminated and possibly restarted.
applicationId | The identifier of the application. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. |
void IToiApplicationService::ReportStarted | ( | in TToiApplicationId | applicationId, | |
in string | address | |||
) | raises (TToiInvalidArgumentException) [inherited] |
This method must be called by the application when it is initialized and has become fully operational. If the application does not do so within the time configured in the application properties, it will be terminated and possibly restarted.
applicationId | The identifier of the application. | |
address | The address where the Application Service can find an IToiApplication interface. |
TToiInvalidArgumentException | Raised if the specified application identifier or the address is invalid. |
void IApplicationService::SetEnvironment | ( | in string | name, | |
in string | value | |||
) | raises (TToiInvalidArgumentException) |
Sets an environment variable for all applications. Only applications started after this call will be affected. If there is an old value for the variable it will be overwritten.
name | The name of the environment variable. | |
value | The value of the environment variable. |
TToiInvalidArgumentException | Raised if someone tries to change the variables "APPLICATION_ID" or "APPMAN_ADDRESS" since they are reserved. |
void IApplicationService::StartInstance | ( | in TToiApplicationId | applicationId, | |
in TObserverId | observerId | |||
) | raises (TToiInvalidArgumentException) |
The function must be called exactly once by each registered observer after the observer received an event that an application has entered STATE_STARTING. It should be called as soon as the observer is ready for the application to start.
applicationId | The identifier of the application. | |
observerId | The identifier of the registered observer. |
TToiInvalidArgumentException | Raised when the supplied application or observer identifier is invalid. |