Template:Java D-Bus snippet
Revision as of 12:49, 19 December 2007 by Wynand.winterbach (talk | contribs) (New page: <pre> import org.freedesktop.DBus; import org.freedesktop.dbus.DBusConnection; import org.freedesktop.dbus.exceptions.DBusException; import org.apertium.Info; // The interface we use to a...)
import org.freedesktop.DBus; import org.freedesktop.dbus.DBusConnection; import org.freedesktop.dbus.exceptions.DBusException; import org.apertium.Info; // The interface we use to access org.apertium.info/ class TestDBus { public static void main(String[] args) throws org.freedesktop.dbus.exceptions.DBusException { DBusConnection bus = null; Info info = null; bus = DBusConnection.getConnection(DBusConnection.SESSION); info = bus.getRemoteObject("org.apertium.info", "/", Info.class); for (String s : info.modes()) { System.out.println(s); } bus.disconnect(); } }