Java DBus sending a Signal

Matthew Johnson dbus at matthew.ath.cx
Thu Jun 24 01:55:49 PDT 2010


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100624/3fbac520/attachment.pgp>


More information about the dbus mailing list