[DBus (name = "org.example.Demo")]
public interface Scanner : GLib.Object {

    public abstract void method_a () throws DBusError;

}

public class KlassA : GLib.Object, Scanner {

    public void method_a () throws DBusError {
        stdout.printf ("Method a\n");
    }

}

static void on_bus_aquired (DBusConnection conn) {
    KlassA obj = new KlassA ();
    try {
        conn.register_object ("/org/example/demo", obj);
    } catch (IOError e) {
        stderr.printf ("Could not register service\n");
    }
}

public static void main(string[] args) {
    Bus.own_name (BusType.SESSION, "org.example.Demo", BusNameOwnerFlags.NONE,
                  on_bus_aquired,
                  () => {},
                  () => stderr.printf ("Could not aquire name\n"));

    new MainLoop ().run ();
}
