Java-dbus First steps
Arigead
captain.deadly at gmail.com
Thu Oct 29 05:41:48 PDT 2009
Hello all,
I'm a bit confused by java-Dbus as I can't find examples of, or see
how to, setup a signal handler. I used dbus-monitor on my laptop for
example and can see a signal coming from rhythm box:
signal sender=:1.66 -> dest=(null destination) serial=16043
path=/org/gnome/Rhythmbox/Player; interface=org.gnome.Rhythmbox.Player;
member=playingChanged boolean false
If I wanted to listen to this signal and simply print a line out when I
received the signal I'm not sure the values to fill into the
addSignalHandler() method. I could use the addSignalHandler() which
accepts a DBusMatchRule and create a rule:
BusMatchRule match = new DBusMatchRule("type",
"org.gnome.Rhythmbox.Player",
"playingChanged");
But I'm not sure what the type should be. boolean? I've tried with a
"boolean" type but that's throwing up a compilation error, not in the
creation of my match but when I try and addSignalHandler which is
protected so I obviously can't call the method with the DBusMatchRule.
I need to use the method:
addSigHandler(Class<T> type, String source, DBusSigHandler<T> handler)
Once again I'm not sure of the type that this call is looking for, Boolean?
Any assistance would be great. I've looked through the API and dbus-java
documentation but I can't see anything that helps.
More information about the dbus
mailing list