Java generic signal handler

minimulisha03 ericcarmody at hotmail.com
Thu Feb 25 09:59:25 PST 2010


I can't seem to get this to work, no matter if i try to match
"type='method_call'" or "type='signal'" i always get the same thing.  It
matches signals and some method returns but never any method calls, anyone
know why this is?

String addr = System.getenv("DBUS_SESSION_BUS_ADDRESS");
dbus_conn = DBusConnection.getConnection(addr); 
BusAddress address = new BusAddress(addr);
conn = new Transport(address);

message = new MethodCall("org.freedesktop.DBus", "/org/freedesktop/DBus",
"org.freedesktop.DBus", "Hello", (byte) 0, null);
conn.mout.writeMessage(message);

message = new MethodCall("org.freedesktop.DBus", "/org/freedesktop/DBus",
"org.freedesktop.DBus", "AddMatch", (byte) 0, "s", "type='method_call'");
conn.mout.writeMessage(message);



Matthew Johnson-3 wrote:
> 
> On Wed Feb 17 14:21, minimulisha03 wrote:
>> 
>> Something like this? Because the only signal I'm catching is
>> NameOwnerChanged....
>> 		dbus_conn = DBusConnection.getConnection(addr); 
>> 		_dbus.AddMatch("type='signal'");
> 
>> 		BusAddress address = new BusAddress(addr);
>>  		conn = new Transport(address);
> 
> You're using the low level API and the high level one here. This won't
> work,
> since I think they use different connections. There's now way to get the
> low
> level transport out from the high level connection at the moment, I'm not
> sure
> if that would be possible, since you 'd be fighting to read messages off
> it.
> 
> You need to create a Message using the low level api for the AddMatch and
> send
> that by hand.
> 
> Matt
> -- 
> www.matthew.ath.cx
> D-Bus Java
> 
>  
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
> 
> 

-- 
View this message in context: http://old.nabble.com/Java-generic-signal-handler-tp27523741p27714494.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list