|
In the X Window System, an X session manager is a session management program, a program that can save and restore the current state of a set of running applications.
OverviewFrom the point of view of an X session manager, a session is a “state of the desktop” at a given time: a set of windows with their current content. More precisely, a session is the set of clients managing these windows or related to them and the information that allows these applications to restore the condition of these windows if required.
In general, a session can be saved or loaded at any time, even if the user is not logging in or out. It is also possible to save a number of different sessions and loading one of them at user's choice. Sessions can also be specified by providing the list of applications that compose the session. As a result, the user has the possibility of saving a set of different sessions, either by storing the state of execution of the currently running applications or by explicitly listing the applications that compose a session. This way, the user can later decide to load a given session. In order for a session to include the state of an application, the application must be able to store and load its current state when appropriate. A protocol named X Session Management Protocol (XSMP) specifies how applications and session managers interact. Of particular importance is that the window manager is able to communicate with the session manager, as the window manager is responsible for the placement of windows and the existence of icons. Applications that cannot store their state can be included in a session, but they do not preserve their state across sessions. The X Window System include a default session manager called The ProtocolThe XSMP is a subprotocol of the Inter-Client Exchange Protocol. The client starts the protocol by connecting to the session manager. How the session manager is located on the network is system-dependent: in a POSIX system, the environment contains a variable IdentifiersThe protocol takes into account two facts:
A session with two instances of xedit open on different files
Different instances of the same application may be active at the same time in the same or in different sessions, and these instances most likely have different states of execution. For example, the user may have launched a text editor on file In order for the sessions to be restored properly, different instances of the same application must be recognized as different by the session manager. For this reason, the session manager chooses a unique identifier for each instance of each application. This way, the session manager is able to distinguish between the text editor that is running on The identifiers must be unique. In particular, they must be unique to all sessions managed by the session manager: the identifier of the text editor running on The main parts of the protocolThe main parts of the protocol of session management are:
The last point is possible because the session manager maintains a set of properties for every client (in the X Window System terminology, a property is simply a container for data). These pieces of information can be modified by the client at any time. One of these properties is named When the session manager requests a client to save its state, the application proceeds as follows:
The session manager maintains other properties beside Local and global stateWhen asking a client to save its state, the window manager can specify whether the local or global state (or both) has to be saved. The difference is whether the result of the save should be visible to the other applications or not. In the case of the text editor, saving the global state means saving the file normally, so that other applications can use the new version of the file. Saving the local state means that a local copy of the file has to be saved, so that other applications cannot see the file has if it has not been saved. An exampleThe following are the main steps in the interaction of a session manager with the hypothetical text editor
When the client is told to save its state, it may have the possibility of having a limited interaction with the user or not (for example, to ask the user if the edited file is to be saved). Anyway, the state is saved, it tells the session manager by sending an appropriate message). When the session is started again, the following take place:
Client-managing sessionsAccording to the XSMP protocol, a session manager is an arbitrary program that runs and controls the state of other applications. As a result, a client can itself be a session manager of other clients. For example, a mail client can start a text editor for the sake of writing an email, and behave as a session manager with respect of the editor. This way, if the mail client is closed and then restarted again, it can restore the state of the text editor. See alsoExternal links
|
||||||||||||||||||||||||||||||||||||
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net