| Home · All Classes · Grouped Classes · Annotated · Functions |
The ApplicationLauncher class is responsible for fundamental application management and IPC routing within Qtopia. More...
#include <ApplicationLauncher>
Inherits QObject.
The ApplicationLauncher class is responsible for fundamental application management and IPC routing within Qtopia.
The ApplicationLauncher provides a Qtopia Server Task. Qtopia Server Tasks are documented in full in the QtopiaServerApplication class documentation.
| Task Name | ApplicationLauncher |
| Interfaces | ApplicationLauncher |
| Services | Suspend |
IPC and application control are tightly linked in Qtopia. At any level higher than the ApplicationLauncher itself, Qtopia does not intrinsically understand the notion of "starting" an application. Qtopia 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, Qtopia 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 Qtopia 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 Qtopia service messages into a form suitable for the application type they manage. For example, while Qtopia 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 Qtopia 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 requested 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 the application, app, can be launched otherwise false. If this method returns true it indicates that an ApplicationLauncherType instance in the system has claimed responsibility for launching the application. The actual launching process may still fail.
Attempt to launch the application, app. This method returns true if the application was launched and false otherwise.
Returns the current state of the application, app.
| Copyright © 2007 Trolltech | Trademarks | Qtopia 4.2.5 |