Java DBus sending a Signal
Arigead
captain.deadly at gmail.com
Thu Jun 24 01:51:54 PDT 2010
Matthew Johnson wrote:
> On Thu Jun 24 08:09, Arigead wrote:
>> I've implemented Java DBus Signal handlers in the past but looking
>> through the documentation I can't see if it's possible to send a signal
>> from Java DBus source. Can't seem to find an example on Internet search.
>> Could somebody tell me is this possible. I'm sure it is but can't find
>> the correct API Calls.
>
> You use the sendSignal method on DBusConnection[0,1] and define the signal class
> derived from DBusSignal[2,3]:
>
> DBusConnection conn = DBusConnection.getConnection(DBusConnection.SESSION);
> MySignal sig = new MySignal("arg1", "arg2");
> conn.sendSignal(sig);
>
> Matt
>
>
> 0. http://dbus.freedesktop.org/doc/dbus-java/dbus-java/dbus-javase2.html#x9-130002
> 1. http://dbus.freedesktop.org/doc/dbus-java/api/org/freedesktop/dbus/AbstractConnection.html#sendSignal(org.freedesktop.dbus.DBusSignal)
> 2. http://dbus.freedesktop.org/doc/dbus-java/dbus-java/dbus-javase4.html#x17-170004
> 3. http://dbus.freedesktop.org/doc/dbus-java/api/org/freedesktop/dbus/DBusSignal.html
Thanks Matthew,
it couldn't be any easier then that.
More information about the dbus
mailing list