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

Help with DBusConnectionBuilder #256

Closed
SammyD57 opened this issue Apr 15, 2024 · 2 comments
Closed

Help with DBusConnectionBuilder #256

SammyD57 opened this issue Apr 15, 2024 · 2 comments

Comments

@SammyD57
Copy link

I've been having some issues trying to get started with this library. I apologise in advance if I'm just missing something simple here.
From what I've seen, in previous version you would create a connection using DBusConnection conn = DBusConnection.getConnection(DBusConnection.SYSTEM); or similar. This now obviously gives me a warning as it's deprecated since version 4.1. The change log states "Deprecated DBusConnection.newConnection/DBusConnection.getConnection, please use DBusConnectionBuilder" but I have no indication of how this is meant to be implemented.

Looking through your documentation on DBusConnection it still says to use the deprecated method. If you could provide any help on this issue or just on using your library in general that would be greatly appreciated. Thanks in advance :)

@hypfvieh
Copy link
Owner

The new builder pattern is explained in the current documentation as well as all examples in the project are already using the new builder.

For your case you can exchange DBusConnection conn = DBusConnection.getConnection(DBusConnection.SYSTEM); with DBusConnectionBuilder.forSystemBus().build(). That's all.

@SammyD57
Copy link
Author

Ah ok thanks a lot I can see where the confusion is now. I was using this documentation https://dbus.freedesktop.org/doc/dbus-java/dbus-java.pdf. Thanks for the quick response.

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

No branches or pull requests

2 participants