diff options
author | Matthew Johnson <mjj29@qadesh.matthew.ath.cx> | 2008-11-18 03:20:08 +0000 |
---|---|---|
committer | Matthew Johnson <mjj29@qadesh.matthew.ath.cx> | 2008-11-18 03:20:08 +0000 |
commit | c1d3dcd4f311f0fa621d9c83210f999741755b7a (patch) | |
tree | 50d0157a94bb488b42d87cb134719e27e9f876d6 /org | |
parent | 5fd501c3a9b4df2740146308fd07ce9a0274ccc9 (diff) |
PeerSet works
Diffstat (limited to 'org')
-rw-r--r-- | org/freedesktop/dbus/DBusConnection.java | 14 | ||||
-rw-r--r-- | org/freedesktop/dbus/bin/DBusDaemon.java | 2 | ||||
-rw-r--r-- | org/freedesktop/dbus/test/test.java | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/org/freedesktop/dbus/DBusConnection.java b/org/freedesktop/dbus/DBusConnection.java index 058a033..43a5b04 100644 --- a/org/freedesktop/dbus/DBusConnection.java +++ b/org/freedesktop/dbus/DBusConnection.java @@ -63,13 +63,15 @@ public class DBusConnection extends AbstractConnection } public void handle(DBus.NameOwnerChanged noc) { + if (Debug.debug) + Debug.print(Debug.DEBUG, "Received NameOwnerChanged("+noc.name+","+noc.old_owner+","+noc.new_owner+")"); if ("".equals(noc.new_owner) && addresses.contains(noc.name)) - synchronized (addresses) { - addresses.remove(noc.name); - } + remove(noc.name); } public boolean add(String address) { + if (Debug.debug) + Debug.print(Debug.DEBUG, "Adding "+address); synchronized (addresses) { return addresses.add(address); } @@ -114,6 +116,8 @@ public class DBusConnection extends AbstractConnection } public boolean remove(Object o) { + if (Debug.debug) + Debug.print(Debug.DEBUG, "Removing "+o); synchronized(addresses) { return addresses.remove(o); } @@ -735,8 +739,4 @@ public class DBusConnection extends AbstractConnection } } } - public PeerSet getPeerSet() - { - return new PeerSet(); - } } diff --git a/org/freedesktop/dbus/bin/DBusDaemon.java b/org/freedesktop/dbus/bin/DBusDaemon.java index bedaff3..fb75241 100644 --- a/org/freedesktop/dbus/bin/DBusDaemon.java +++ b/org/freedesktop/dbus/bin/DBusDaemon.java @@ -240,7 +240,7 @@ public class DBusDaemon extends Thread } int rv; - if (exists) { + if (!exists) { rv = DBus.DBUS_RELEASE_NAME_REPLY_NON_EXISTANT; } else { if (Debug.debug) Debug.print(Debug.WARN, "Client "+c.unique+" acquired name "+name); diff --git a/org/freedesktop/dbus/test/test.java b/org/freedesktop/dbus/test/test.java index a4b1ae4..5333723 100644 --- a/org/freedesktop/dbus/test/test.java +++ b/org/freedesktop/dbus/test/test.java @@ -774,7 +774,7 @@ public class test serverconn.sendSignal(new TestSignalInterface.TestObjectSignal("/foo/bar/Wibble", tclass)); // setup bus name set - Set<String> peers = serverconn.getPeerSet(); + Set<String> peers = serverconn.new PeerSet(); peers.add("org.freedesktop.DBus"); clientconn.requestBusName("test.testclient"); peers.add("test.testclient"); |