Re: Java Signal Handler

Mário Costa <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <CALGGjJZN8o172ZjCEu1kBX6Z6CPJE1DdAenOt6yMuutcQbaw+g@mail.gmail.com>
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 <[email protected]> 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
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.