Template:Java D-Bus snippet
Revision as of 12:54, 19 December 2007 by Wynand.winterbach (talk | contribs) (Java D-Bus snippet moved to Template:Java D-Bus snippet: To make {{}} syntax work)
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(); } }