Upload
trandang
View
219
Download
5
Embed Size (px)
Citation preview
D-BusOpen-Source IPC
Wednesday, June 19, 13
What Is It?
Multi-platform (Linux, OSX, Windows)Multi-language (Java, PHP, .NET, etc.)Small-footprintBus-basedStandard for IPC
Wednesday, June 19, 13
Any Distinguishing Features?
Object Oriented - Methods and SignalsService DiscoveryIntrospectionBinary ProtocolSecureLarge Developer and User Base
Wednesday, June 19, 13
Who Uses It?
All KDE users and Most GNOME usersPidgin, Skype and CUPS usersLinux HAL (Hardware Abstraction Layer)Any Linux System that Supports Hot Plugging Devices
Wednesday, June 19, 13
Language Support?
Python, Qt, Java, Perl, C++, PHP, Pascal, .NET, Ruby, Scheme, Tcl, Squeak (smalltalk variant), Haskell, Ocaml, Gambas, Objective-C, and Ada
Wednesday, June 19, 13
Architecture?
Processes Attach to Bus & Get Address (e.g. edu.nrao.casa.clean)
Processes Make Objects (services) Available (e.g. /casa/clean_server)
Objects Provide One or More Interfaces (e.g clean.multiscale)
Wednesday, June 19, 13
Bindings We Care About (Python)
bus = dbus.SessionBus( )
obj = bus.get_object(‘edu.nrao.edu.clean’,’/casa/clean_server’)
proxy = dbus.Interface(obj,‘clean.multiscale’)
Wednesday, June 19, 13
Bindings We Care About (Qt)
QDBusInterface proxy(‘edu.nrao.casa.clean’,’/casa/clean_server’,‘clean.multiscale’)
proxy.call(“method”, arg1, arg2, ...)
Wednesday, June 19, 13
Bindings We Care About (C++ without Qt)
dbusxx-xml2cpp is used to generate abstract base classes (proxy and adaptor) from XML descriptionthe abstract base make it trivial to provide or access services on D-Bus
Wednesday, June 19, 13
What about providing services (Python)
class Example(dbus.service.Object): def __init__(self, object_path): dbus.service.Object.__init__(self, bus, path)
@dbus.service.method(‘clean.multiscale’, ...) def methodname( self, ... ) <do-work-here>
Wednesday, June 19, 13
What about providing services (Qt)
class adaptor : public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO( “D-Bus Interface”, “edu.nrao.casa.clean_server”);
QDBusVariant method( ... );
Wednesday, June 19, 13
Bindings We Care About (C++ without Qt)
dbusxx-xml2cpp is used to generate abstract base classes (proxy and adaptor) from XML descriptionthe abstract base make it trivial to provide or access services on D-Bus
Wednesday, June 19, 13
Supported Types
byte double
boolean string
int16 uint16
int32 uint32
int64 uint64
structure
array
variant
map
object path
signature
unix fd
Wednesday, June 19, 13
Sometimes Things Change
complete configuration via an xml filemultiple authentication methods supported, including “external”timeouts, limits, security policiesmultiple transport methods, including pipes and sockets
Wednesday, June 19, 13