Java Signal Handler

Mário Costa mario.silva.costa at gmail.com
Tue Dec 1 16:28:24 PST 2015


Hi,

The java code has long been unmaintained, and would certainly benefit from
some refactoring ...

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.

Use one of these tools to check the server signals ...
http://www.freedesktop.org/wiki/Software/DbusTools/

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 ...

The server will have to export a DBus interface, even if not complete, it
should have the introspection method ...

Best of luck,
mc

On Tue, Dec 1, 2015 at 4:13 PM, Sören Busse <soeren.2011 at live.de> wrote:

> Hi,
>
> I am trying to add a Signal Handler on a DirectConnection.
>
> So I used:
>
> *DirectConnection conn = new DirectConnection("tcp:host=" + HOST
> +",port=4242");*
>
> *conn.addSigHandler(new
> DBusMatchRule("signal","/thomas/server","CpuLoadChange"), new Handler());*
>
>
> *public class Handler implements DBusSigHandler<DBusSignal>{*
>
> *    @Override*
> *    public void handle(DBusSignal sig) {*
> *        try {*
> *            System.out.println(Arrays.toString(sig.getParameters()));*
> *        } catch (DBusException e) {*
> *            // TODO Auto-generated catch block*
> *            e.printStackTrace();*
> *        }*
> *    }*
>
> *}*
>
>
> Problem is, that the handle method isn't executed. Is there a fix for this?
> I can't use a DBusInterface, because the server isn't implementing one.
>
> <https://www.avast.com/?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Diese
> E-Mail wurde von einem virenfreien Computer gesendet, der von Avast
> geschützt wird.
> www.avast.com
> <https://www.avast.com/?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#1515e566223c8c9f_DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20151202/4b2dc8a5/attachment.html>


More information about the dbus mailing list