Java generic signal handler

minimulisha03 ericcarmody at hotmail.com
Wed Feb 17 14:21:34 PST 2010


Something like this? Because the only signal I'm catching is
NameOwnerChanged....

static DBus _dbus;
static DBusConnection dbus_conn;

  @SuppressWarnings("unchecked")
  public static void main(String args[]) {
	try{	
		String addr = System.getenv("DBUS_SESSION_BUS_ADDRESS");
		dbus_conn = DBusConnection.getConnection(addr); 
        	_dbus = dbus_conn.getRemoteObject("org.freedesktop.DBus",
"/org/freedesktop/DBus", DBus.class);
		_dbus.AddMatch("type='signal'");
		BusAddress address = new BusAddress(addr);
 		conn = new Transport(address);
                while(true){
                   Message m = conn.min.readMessage();
                   System.out.println(m.toString());
                }
       }catch(Exception e){
       }

Matthew Johnson-3 wrote:
> 
> On Tue Feb 16 14:07, minimulisha03 wrote:
>> 
>> If you get a chance do you think you could give me an example of how to
>> register a match with the bus daemon cause I just can't seem to figure
>> out
>> how....
> 
> You need to call the org.freedesktop.DBus.AddMatch method on the
> /org/freedesktop/DBus object on the special org.freedesktop.DBus service.
> 
> 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-tp27523741p27631294.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list