How to generate java call interface file based on d-bus service developed by linux c/c++

What is dbus?
There is an article called " D-Bus Tutorial " on the Internet , which is widely spread. A lot of information about dbus has quoted paragraphs in it. In fact, relative to this article, I suggest you read the " D-Bus Specification " directly . The length is not too long and the text is not boring.

D-Bus is an IPC (interprocess communication) mechanism optimized for the desktop environment, used for communication between processes or between processes and the kernel. The most basic D-Bus protocol is a one-to-one communication protocol. But in many cases, through

One side of the letter is the message bus. The message bus is a special application that communicates with multiple applications at the same time and transfers messages between applications. Below we will observe the role of the message bus in an example. The role of the message bus is somewhat similar to the X system

In the window manager, the window manager is both an X client and responsible for managing windows.

At the same time, D-Bus can also cross the application channel between remote machine processes and supports the integration between different languages. At present, we have a project that uses D-Bus as an internal bus to easily develop services developed by linux c/c++ and web java. Applications

Integration, so as to achieve a distributed architecture with d-bus as the internal bus and web java as the external general. Today we are going to talk about how to generate java call interface files based on the d-bus service developed by linux c/c++. This article Suitable for developers who have a certain understanding of d-bus.

Preparation:
a linux system machine

1. For example, ubuntu8.04 desktop is the version. Assume that the d-bus environment has been installed and a tang-sdc d-bus service is running on it. The machine IP is 192.168.12.32 and the d-bus bus address is

tcp:host=192.168.12.32,port=53557,guid=597dbd5272eacdcf7857b1054dd207e1, the following work is to generate tang-sdc service java interface
input command installation


The revised content is as follows


 Enter the command to run


Result:

enter the command to install


Enter the command to run

 

result

 

1. Use vncViewer to log in to the 192.168.12.32:1 desktop


2. The window interface of DBusViewer appears

 

 

 

3. Click Introspect

 

4. Click Save all... to save the interface file

 

Click Select to choose the saved path

 

 

This is the generated java interface file, which can be referenced in the java project to call the interface of the linux c/c++ d-bus service.

 

 

Guess you like

Origin blog.csdn.net/panpanloveruth/article/details/6429150