<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br></div>The java code has long been unmaintained, and would certainly benefit from some refactoring ...<br><br></div>I've looked at the code a bit at the code, I would say you need an interface, an to export the remote object from the server to register the signals.<br><br></div>Use one of these tools to check the server signals ... <a href="http://www.freedesktop.org/wiki/Software/DbusTools/">http://www.freedesktop.org/wiki/Software/DbusTools/</a><br><br></div>There is a java class, that is meant to also debug the dbus, and extract java interfaces from the introspection. Use the tools to check which interfaces the server exports, and use the /dbus-java/src/main/java/org/freedesktop/dbus/bin/CreateInterface.java to create a java interface ...<br><br></div>The server will have to export a DBus interface, even if not complete, it should have the introspection method ...<br><br></div>Best of luck,<br></div>mc<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 1, 2015 at 4:13 PM, Sören Busse <span dir="ltr"><<a href="mailto:soeren.2011@live.de" target="_blank">soeren.2011@live.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><p dir="ltr">Hi,</p>
<p dir="ltr">I am trying to add a Signal Handler on a DirectConnection.</p>
<p dir="ltr">So I used:</p>
<blockquote><p dir="ltr"><i>DirectConnection conn = new DirectConnection("tcp:host=" + HOST +",port=4242");</i></p>
<p dir="ltr"><i>conn.addSigHandler(new DBusMatchRule("signal","/thomas/server","CpuLoadChange"), new Handler());</i><br>
</p>
</blockquote>
<p dir="ltr"><br></p>
<blockquote><p dir="ltr"><i>public class Handler implements DBusSigHandler<DBusSignal>{</i></p>
<p dir="ltr"><i> @Override</i><br>
<i> public void handle(DBusSignal sig) {</i><br>
<i> try {</i><br>
<i> System.out.println(Arrays.toString(sig.getParameters()));</i><br>
<i> } catch (DBusException e) {</i><br>
<i> // TODO Auto-generated catch block</i><br>
<i> e.printStackTrace();</i><br>
<i> }</i><br>
<i> }</i></p>
<p dir="ltr"><i>}</i></p><p dir="ltr"><i></i><br>
</p>
</blockquote>
<p dir="ltr">Problem is, that the handle method isn't executed. Is there a fix for this?</p>
I can't use a DBusInterface, because the server isn't implementing one. <br><div><table style="border-top:1px solid #aaabb6;margin-top:10px">
<tbody><tr>
<td style="width:105px;padding-top:15px">
<a href="https://www.avast.com/?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/logo-avast-v1.png" style="width:90px;min-height:33px"></a>
</td>
<td style="width:470px;padding-top:20px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Diese E-Mail wurde von einem virenfreien Computer gesendet, der von Avast geschützt wird. <br><a href="https://www.avast.com/?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:#4453ea" target="_blank">www.avast.com</a> </td>
</tr>
</tbody></table>
<a href="#1515e566223c8c9f_DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div> </div></div>
<br>_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
<br></blockquote></div><br></div>