Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to export/publish Property in interface? #242

Open
JiaAnWei opened this issue Nov 22, 2023 · 2 comments
Open

How to export/publish Property in interface? #242

JiaAnWei opened this issue Nov 22, 2023 · 2 comments
Labels

Comments

@JiaAnWei
Copy link

Hello all,
I am a newbie use this dubs-Java 3.2.3 for jdk8,
and can’t find any tutorial to export/publish Property
like the busctl view below.

NAME. TYPE. SIGNATURE RESULT/VALUE
foo.bar interface - -
.helloWorld method - a
.IDprop property u 12345

I could only export an interface with helloWorld,
but didn’t find any way to add Property to interface.
Any one can help? Thank all!

@hypfvieh
Copy link
Owner

Please stop using ancient versions of dbus-java or Java!
dbus-java 3.x is EOL since 09/2022, probably has several bugs and will no longer be supported by any means.
Also using Java versions which are EOL since 03/2022 (only commerical "support" still available) is a bad idea due to missing security fixes etc.

Anyway, to publish a property on the bus, you may take a look at DBusProperty annotation. See javadoc in the class on how to use it.
I can only highly endorse the use of dbus-java 5.x (no release yet, but snaphots are available), which greatly improves the way to use or provide properties on DBus (see #235) and uses a lot of the features Java 17 provides for about 2 years. It also fixes a lot of bugs, concurrency issues, removes the use of unsupported/unmaintained libmatthew and so on.

@JiaAnWei
Copy link
Author

Thanks for your support, hypfvieh.
That’s really a good choice to use new version,
and the annotations looks very friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants