Creating a DBusInterface in Java

Urizev urizev at gmail.com
Wed May 21 05:47:44 PDT 2008


Hi everyone,

I want to do HAL requests via DBUS. However my application must be
developed in Java. I have searched documentation but I think it is not
enough. The first problem I find is how to build a pre-existent dbus
interface. For example, if I want to request the device list to HAL, I
would have to use the GetAllDevices from org.freedesktop.hal.manager.
The code would be like this:

	...
	DBusConnection conn = DBusConnection.getConnection(DBusConnection.SYSTEM);
				
	CreateInterface hola = new CreateInterface ();
	DBusInterface hal = conn.getRemoteObject("org.freedesktop.Hal",
"/org/freedesktop/Hal/Manager");

-->   hal.GetAllDevices();

	conn.disconnect();
	...

As it is supposed, hal has not the GetAllDevices method. I know it is
possible to create the class with CreateInterface, but I do not know
how. Beside, I think that this process would can be automatic since it
is possible to request for the introspection data of the interface via
DBUS. I do not know if how can I use the API. If anybody has some
information, any reference or example, I would really appreciate it.

Regards

Juan Carlos


More information about the dbus mailing list