Improved version of Java-DBus library provided by freedesktop.org with support for Java 11+.
The new major is no drop-in replacement for 2.7.x or 3.x.x version! It requires code changes and at least Java 11.
Main difference is the separation of dbus-java functions (now called dbus-java-core) and the transports. A transport provides the code to connect to DBus daemon on various ways (e.g. unix socket or TCP).
When updating to 4.x you have to add at least one transport to your project. If you add a unix socket transport, you have to choose between jnr-unixsocket and native-unixsocket. The later will require Java 16+, while jnr-unixsockets will work with Java 11 but will pull-in jnr-posix and friends to your project.
The native-unixsockets will work almost like the jnr-unixsockets except it does not support abstract unixsockets. If you don't know what abstract unixsockets are, you'll probably don't need it and you can use native-unixsockets when using proper Java version.
If you use TransportFactory
directly, you have to replace it with TransportBuilder
.
If you have used the SPI to extend the MessageReader/Writer of dbus-java, you have to update your code. Old providers will not work with dbus-java 4.x because of changed SPI interfaces (sorry!).
The changes were required due to the support of native-unixsocket which is using java.nio, while the old dbus-java code uses the old java.io socket API.
With dbus-java 4.x, java.nio is used for all transports and therefore required changes on the SPI.
ISocketProvider
will now use SocketChannel
instead of Socket
in the exported methods.
See the list in our Wiki
This project receives code contributions and donations from LogonBox.
However LogonBox is not responsible for this project and does not take influence in the development.
The library will remain open source and MIT licensed and can still be used, forked or modified for free.
- Fixed regression not allowing to use classes directly implementing
DBusInterface
to be exported on the bus (#157) - Throw AuthenticationException when SASL command was unreadable during logon handshake, thanks to brett-smith (PR#158)
- Fixed issue with handling signals in wrong order (#159)
- Applied changes found by PMD/IntelliJ static code analyzers
- Deprecated
DBusConnection.newConnection
/DBusConnection.getConnection
, please use DBusConnectionBuilder - Deprecated public constructors of
DirectConnection
, please use DirectConnectionBuilder - Added dbus-java-example module which contains samples and demonstration code on how to use dbus-java
- Requires at least Java 11
- Added transport which uses native unix sockets provided by Java 16+ (see: #145)
- Splitted dbus-java to multiple modules:
- dbus-java-core: Core dbus-java functions (always required)
- dbus-java-transport-jnr-unixsocket: Unix socket support based on jnr-unixsocket
- dbus-java-transport-native-unixsocket: Unix socket support based on native unix sockets (Java 16+ required)
- dbus-java-transport-tcp: TCP based DBus messaging
- dbus-java-utils: utilities which may help during development
- Updated dependencies
- Fixed some issues in InterfaceCodeGenerator related to signal constructors, thanks to poeschel (PR#146)
- Fixed some issues in InterfaceCodeGenerator related to usage of Tuples, thanks to poeschel (PR#147)
- Improved SASL authentication with domain sockets on OS X, thanks to brett-smith (PR#148)
- Fixed some issues related to marshalling/unmarshalling of Tuples, thanks to poeschel (PR#149)
- Fixed various issues in Introspection generation introduced with PR#143 and in marshalling caused by PR#149
- Fixed issue with interupted status of thread got lost after a synchronous method call was interrupted #150
CAUTION - This version may contain breaking changes!!
- Removed usage of java-utils
- Moved Hexdump class from org.freedesktop to org.freedesktop.dbus.utils
- Moved DBus interface from org.freedesktop to org.freedesktop.dbus.interfaces
- Modulize dbus-java (PR#125, thanks to brett-smith)
- DBusConnection.getConnection(DBusBusType _bustype) will no longer throw RuntimeException but DBusConnectionException if something went wrong establishing DBus connection #128
- Support annotation to specify properties provided by an exported object (DBusProperty annotation) (PR#131/#130), thanks to mk868
- Added support for the new DBusProperty annotations in InterfaceCodeGenerator Util (PR#132), thanks to mk868
- License changed from LGPLv2 to MIT
- Improved logging usage of Arrays.deepToString(Object[]), so this message will not be called in log statements if the loglevel is not enabled
- Improved usage of regex and length checks #119 & PR#120 (thanks to OlegAndreych)
- Improvements in InterfaceCodeGenerator Util regarding creation of Struct classes (#121)
- Fixed possible race-conditions/dead-locks when disconnecting from DBus (#123)
- Fixed issue with introspection caused by changes in #80 (#103), thanks to AsamK
- Added support for FreeBSD, (#105) thanks to grembo
- Fixed SASL authentication may get stuck when using TCP (#106) thanks to brett-smith
- Fixed issues when dealing with multiple signals of the same name but different signatures (#110)
- Dependency updates
- Fixed leaking signal handlers when using addSigHandler/removeSigHandler a lot (#76)
- Fixed unexported objects shown in introspection output (#80)
- Added support for providing alternative implementations of IMessageReader/IMessageWriter (#81)
- Removed support for file descriptor passing, as it is not working with jnr-unixsocket (#81)
- Fixed issue dealing with handled signals (#97)
- Fixes issue with InterfaceCodeGenerator util (#95)
- Fixes issue with InterfaceCodeGenerator util using incorrect type (#83)
- Replaced libmatthew with jnr-unixsocket
- Removed all native library files and sources
- Added new transport system to use jnr-unixsocket (replaces old Transport class)
- Added support for empty collections/arrays (thanks to chris-melman)
- Added support of DBUS_MACHINE_ID_LOCATION environment property to allow usage of dbus-java on Windows (thanks to chris-melman)
- Allow change of the default socket timeout (thanks to chris-melman)
- Detect system endianness for DBus message instead of using BIG endian all the time (#54)
- Allow changing the default endianness (DBusConnection.setEndianness())
- Providing OSGi ready artifact (#33) (thanks to stack-head)