Citizendia
Your Ad Here

D-Bus
Latest release 1. A software release is the distribution whether public or private of an initial or new and upgraded version of a Computer software product 1. 20 / February 27, 2008
OS Cross-platform
Genre Inter-process communication
License GPL or Academic Free License 2. Events 1560 - The Treaty of Berwick, which would expel the French from Scotland, is signed by England and the Congregation 2008 ( MMVIII) is the current year in accordance with the Gregorian calendar, a Leap year that started on Tuesday of the Common An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination In computing cross-platform (also known as multi-platform) is a term used to refer to Computer software or computing methods and concepts that are implemented Computer software can be organized into categories based on common function type or field of use Inter-Process Communication ( IPC) is a set of techniques for the exchange of data among two or more threads in one or more processes. A software license (or software licence in commonwealth usage is a Legal instrument governing the usage or redistribution of copyright protected software The Academic Free License (AFL is a Permissive free software license written in 2002 by Lawrence E 1[1]
Website freedesktop.org/wiki/Software/dbus

D-Bus is a free software project which offers a simple way for applications to communicate with one another. A website (alternatively web site or Web site, a back-construction from the Proper noun World Wide Web) is a collection of Web pages Free software or software libre is Software that can be used studied and modified without restriction and which can be copied and redistributed in modified or unmodified It is developed by Red Hat as part of the freedesktop.org project. In Computing, Red Hat Inc ( is a company dedicated to Free and open source software, and a major Linux distribution vendor

D-Bus was heavily influenced by KDE2–3's DCOP system and has replaced it in the KDE 4 release; it is already implemented in Qt 4, GNOME, Windows, the maemo mobile platform, and the OLPC XO-1. KDE ( K Desktop Environment) (ˌkeɪdiːˈiː is a Free software project which aims to be a powerful system for an easy-to-use Desktop environment. DCOP, which stands for D esktop CO mmunication P rotocol, is a light-weight interprocess and Software componentry Qt (pronounced "cute" by its creators is a Cross-platform application development framework widely used for the development of GUI programs (in which A gnome is a Mythical creature characterized by its extremely small size and subterranean lifestyle Microsoft Windows is a series of Software Operating systems and Graphical user interfaces produced by Microsoft. The XO-1, previously known as the $100 Laptop or Children's Machine, is an inexpensive Laptop computer intended to be distributed to children in developing In GNOME it has gradually replaced most parts of the earlier Bonobo mechanism. Bonobo is a component model for creating reusable software components and compound documents

Contents

Introduction

D-Bus (Desktop Bus) allows programs to register on it for offering services to others. In the context of Enterprise architecture, Service-orientation, and Service-oriented architecture, the term service refers to a discretely defined set of It also offers client programs the possibility to look up which services are available. Programs can also register as waiting for events of the kernel like hot swapping hardware. In Computer science, the kernel is the central component of most computer Operating systems (OS Hot swapping and hot plugging are terms used to separately describe the functions of replacing system components hot swapping describes changing components like fans and

D-Bus is implemented as a daemon. In Unix and other computer multitasking Operating systems a daemon (ˈdiːmən or /ˈdeɪmən/ is a Computer program that runs in the background Users can run several instances of it, each called a channel. There will usually be a privileged system channel, and a private instance for each logged in user. The private instances are required because the system channel has access restrictions.

The main mission of the system channel is to deliver the signals from the HAL daemon to the processes interested in them. In the field of Unix-like Software, HAL, a Hardware abstraction layer and Software project developed by Red Hat, The mission of the private instances is to provide unrestricted communication among any applications of the user.

Architecture

D-Bus is an inter-process communication (IPC) system[2] with three architectural layers:

D-Bus is designed for two specific cases:

Mechanisms

Each application using D-Bus contains objects, which generally (but not necessarily) map to GObject, QObject, C++ objects, or Python objects. In its simplest embodiment an object is an allocated region of storage The GLib Object System, or GObject, is a free Software library (covered by the LGPL) that provides a portable Object system C++ (" C Plus Plus " ˌsiːˌplʌsˈplʌs is a general-purpose Programming language. Python is a general-purpose High-level programming language. Its design philosophy emphasizes programmer productivity and code readability An object is an instance rather than a type. In its simplest embodiment an object is an allocated region of storage A data type in Programming languages is an attribute of a datum which tells the computer (and the programmer something about the kind of datum it is When messages are received over a D-Bus connection, they are sent to a specific object, not to the application as a whole. In this way, D-Bus resembles software componentry, as it appears to the user as if an object is serialized across the IPC connection, no matter if there is an object on the other side or not. Component-based software engineering (CBSE (also known as Component-Based Development (CBD or Software Componentry) is a branch of the Software engineering In Computer science, in the context of data storage and transmission serialization is the process of saving an object onto a storage medium (such as a

To allow messages to specify their destination object, there has to be a way to refer to an object. In many programming languages, this is usually called a pointer or reference. However, these references are implemented as memory addresses relative to the address space of the application, and thus can't be passed from one application to another.

To solve this, D-Bus introduces a name for each object. The name looks like a filesystem path, for example an object could be named /org/kde/kspread/sheets/3/cells/4/5. Human-readable paths are preferred, but developers are free to create an object named /com/mycompany/c5yo817y0c1y1c5b if it makes sense for their application.

The D-Bus objects' names are namespaced to ensure different code modules are kept separated. A namespace is an abstract container or environment created to hold a logical grouping of unique identifiers (i Namespaces are generally prefixed with the developer's domain name components (eg. /org/kde).

Implementations

Examples

Most languages allow high-level access to D-Bus, hiding implementation details and optimizing marshalling, queuing and dispatching behind the scenes. The Cleanroom Software Engineering process is a Software development process intended to produce software with a certifiable level of Reliability. In Computer science, marshalling (similar to Serialization) is the process of transforming the memory representation of an object to a data format suitable for In statically typed programming languages such as C# and Java, the interface to be used or exported must first be defined. In Computer science, a type system defines how a Programming language classifies values and expressions into '''types''', how it can C# (pronounced C Sharp is a Multi-paradigm To access HAL devices, a partial interface description in the C# language may look something like this:

For the device interface:

/* an Interface attribute is applied to mark the D-Bus interface name */
[Interface ("org. freedesktop. Hal. Device")]
public interface Device
{
        /* event definitions map to D-Bus signals */
        event PropertyModifiedHandler PropertyModified;
 
        /* properties and method calls map to D-Bus calls */
        /* the D-Bus type system is capable of representing generic dictionaries */
        IDictionary<string, object> AllProperties { get; }
 
        /* further methods and signals omitted for brevity */
}
 
/* D-Bus supports arbitrary structures */
public struct PropertyModification
{
        public string Key;
        public bool Added;
        public bool Removed;
}
 
public delegate void PropertyModifiedHandler (int modificationsLength,
                                        PropertyModification[] modifications);

For the device manager interface:

[Interface ("org. freedesktop. Hal. Manager")]
public interface Manager
{
        /* event definitions map to D-Bus signals */
        event Action<Device> DeviceAdded;
        event Action<Device> DeviceRemoved;
 
        /* properties and method calls map to D-Bus calls */
        Device[] AllDevices { get; }
        bool DeviceExists (Device udi);
        bool DeviceExists (ObjectPath udi);
        Device[] FindDeviceStringMatch (string key, string value);
        Device[] FindDeviceByCapability (string capability);
        void Remove (Device udi);
 
        /* further methods and signals omitted for brevity */
}

Once these interfaces have been defined, the programmer is able to obtain proxy objects mirroring remote counterparts and manipulate them directly as though they were in the local address space:

/* request a proxy object for the device manager from the system message bus */
Manager mgr = Bus. In Computer programming, the proxy pattern is a Software design pattern. System. GetObject<Manager> ("org. freedesktop. Hal",
                                new ObjectPath ("/org/freedesktop/Hal/Manager"));
 
/* enumerate all devices */
foreach (Device dev in mgr. AllDevices) {
        /* print the path of the object  */
        Console. WriteLine (dev. ToString ());
 
        /* hook up to the PropertyModified signal of the device */
        dev. PropertyModified += delegate (int modificationsLength,
                                        PropertyModification[] modifications) {
                /* when properties are modified, print the changes */
                Console. WriteLine ("Properties changed on device {0}:", dev);
 
                foreach (PropertyModification modification in modifications)
                        Console. WriteLine (modification. Key);
        };
}

References

  1. ^ Havoc's Blog July, 2007
  2. ^ Get on the D-BUS. Linux Journal. Linux Journal is a monthly Magazine published by Belltown Media Inc Retrieved on 2008-01-23. 2008 ( MMVIII) is the current year in accordance with the Gregorian calendar, a Leap year that started on Tuesday of the Common Events 393 - Roman Emperor Theodosius I proclaims his nine year old son Honorius co-emperor
  3. ^ Alp Toker, D-Bus mailing list (2006).
  4. ^ Matthew Johnson, D-Bus mailing list (2007).

External links


© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic