ApplicationLauncher Class Reference
|
Task Name | ApplicationLauncher |
Interfaces | ApplicationLauncher |
Services | Suspend |
IPC and application control are tightly linked in Qtopia. At any level higher than the ApplicationLauncher itself, Qt Extended does not intrinsically understand the notion of "starting" an application. Qt Extended treats an application as a named IPC endpoint that exposes one or more IPC services for use by other applications or the system itself. The named IPC endpoint is known as the application's "application channel".
The primary role of the ApplicationLauncher is to manage a component's ability to receive and respond to service requests. The ApplicationLauncher considers an application "running" when it is able to receive service messages even though the application may not be thought as such by an end user. Management of end user features of an application (such as when the UI is raised or hidden) is done by other system components.
The application launcher framework consists of three primary parts - the application launcher, a series of application type launchers and the application IPC router.
Internally the ApplicationLauncher class has a very basic model of an application - it is something that can be started, stopped and can receive IPC messages. The specifics of process control is handled by pluggable implementers of the ApplicationTypeLauncher interface. By separating the specifics in this way, Qt Extended can easily be adapted to handle foreign applications, such as Java applications, in a seamless and highly integrated fashion.
The ApplicationLauncher also doesn't intrinsically know the specifics of the IPC bus. Instead an implementation of the ApplicationIpcRouter class abstracts the details from it.
When the system attempts to start an application by sending it a message on its application channel, the ApplicationIpcRouter detects the message and asks the ApplicationLauncher to launch the application, by calling the ApplicationLauncher::launch() method. This instructs the ApplicationLauncher to bring the application to a state where it can receive IPC messages.
If the application is not running, the ApplicationLauncher iterates through the ordered list of tasks implementing the ApplicationTypeLauncher interface. Each task is asked if it can launch the application, and if it can, is asked to do so. The ApplicationLauncher monitors the progress of the ApplicationTypeLauncher through Qt signals, which it consolidates and emits to the rest of the Qt Extended server.
Once the application is ready to receive messages, the ApplicationTypeLauncher informs the router by invoking the ApplicationIpcRouter::addRoute() method, passing an implementation of the ApplicationIpcRouter::RouteDestination interface. This call instructs the IPC Router to forward messages to the application through the ApplicationIpcRouter::RouteDestination. All queued messages will be delivered at this time.
How the ApplicationIpcRouter::RouteDestination implementation (usually the ApplicationTypeLauncher) handles delivery of the message is up to it. This allows more advanced ApplicationTypeLauncher implementations - such as a Java application type launcher - to adapt Qt Extended service messages into a form suitable for the application type they manage. For example, while Qt Extended uses a "raise()" message sent to an application's application channel to cause it to show its main UI, a Java application that has no notion of Qt Extended messages will need to have this message transformed appropriately.
To summarize,
Component | Class | Functionality |
---|---|---|
Application Launcher | ApplicationLauncher | Manages ApplicationTypeLauncher instances and maintains a consolidated view of applications. Other components within the server may use the ApplicationLauncher to monitor application state, but must remember that this state only represents an applications ability to receive IPC messages, and not necessarily user visible information such as whether the application is visible. |
Application Type Launchers | ApplicationTypeLauncher | Handles the specifics of different types of applications and launching mechanisms on behalf of the ApplicationLauncher. Other components within the server should never need to access these instances directly. |
Application Ipc Router | ApplicationIpcRouter | Abstracts the IPC transport used for application messages from the ApplicationLauncher. On reception of an application message, instructs the ApplicationLauncher to start the application and subsequently delivers messages to ApplicationTypeLauncher instances for possible transformation before delivery to the application. |
Emitted whenever a non-existant application is asked to launch. The corresponding call to launch() will also return false.
Emitted whenever the application state changes to state.
Emitted whenever the application terminates. reason will be set to the termination reason. If filtered is true, an ApplicationTerminationHandler instance has filtered the termination.
Return the list of starting and running applications. The list order represents the order in which the applications were launched.
Returns true if application app can be launched. Returns false otherwise. When true is returned, it means an instance of a subclass of ApplicationTypeLauncher instance exists that knows how to launch the application. The subsequent attempt to launch the application may still fail.
Note that true is also returned if app is already running.
Attempts to launch application app. Returns true if app is launched successfully. Also returns true if app is already running. Returns false if no launcher can be found that knows how to launch app.
Returns the current state of the application, app.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtextended4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com