java-systemd

Java access to systemd via D-Bus

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.github.thjomnx
ArtifactId

ArtifactId

java-systemd
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

java-systemd
Java access to systemd via D-Bus
Project URL

Project URL

https://github.com/thjomnx/java-systemd
Source Code Management

Source Code Management

https://github.com/thjomnx/java-systemd

Download java-systemd

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.thjomnx/java-systemd/ -->
<dependency>
    <groupId>com.github.thjomnx</groupId>
    <artifactId>java-systemd</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.thjomnx/java-systemd/
implementation 'com.github.thjomnx:java-systemd:2.1.0'
// https://jarcasting.com/artifacts/com.github.thjomnx/java-systemd/
implementation ("com.github.thjomnx:java-systemd:2.1.0")
'com.github.thjomnx:java-systemd:jar:2.1.0'
<dependency org="com.github.thjomnx" name="java-systemd" rev="2.1.0">
  <artifact name="java-systemd" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.thjomnx', module='java-systemd', version='2.1.0')
)
libraryDependencies += "com.github.thjomnx" % "java-systemd" % "2.1.0"
[com.github.thjomnx/java-systemd "2.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
com.github.hypfvieh : dbus-java jar 3.3.0
javax.xml.bind : jaxb-api jar 2.4.0-b180830.0359
org.slf4j : slf4j-api jar 1.7.30
org.slf4j : slf4j-simple jar 1.7.30

test (3)

Group / Artifact Type Version
org.testng : testng jar 7.4.0
org.mockito : mockito-inline jar 3.8.0
org.awaitility : awaitility jar 4.0.3

Project Modules

There are no modules declared in this project.

Build Status Quality Gate Status Maintainability Rating Coverage Lines of Code Maven Central License: LGPL v2.1 License: AFL 3.0

java-systemd

Java access to systemd via D-Bus. Java D-Bus bindings (dbus-java) are required.

This library shall:

  • Provide Java access to systemd interfaces via D-Bus (Manager, Unit, Service, Target, etc.)
  • Provide adapters for the internals of the dbus-java API in order to
    • ease the access to systemds methods and properties
    • omit automatic (and low-performance) reflection stuff being done in dbus-java
    • provide observer-like patterns for objects along D-Bus signalling

Versions

There are two major versions available on the central repository:

  • 2.x (depends on dbus-java version 3)
    • 2.1.x and later deploy this library as a Java module in the JPMS
  • 1.x (depends on dbus-java version 2)

Usage

Documentation and instructions how to use this library can be found in the Wiki.

Testing

Unit tests are based on TestNG and Mockito. Test methods which require a deployed systemd environment are grouped in TestNG group "requireSystemd". There are two TestNG suites available:

  • src/test/resources/suites/auto-systemd.xml (executes all tests)
  • src/test/resources/suites/auto.xml (excludes group "requireSystemd")

Contributions

  • Thanks to brett-smith for initial migration work to support dbus-java version 3 and for JPMS support.

License

LGPL v2.1 and AFL 3.0.

Disclaimer

These are no "official" Java bindings for systemd via D-Bus. I only work on it if the following requisites are met:

  • The kids are sleeping
  • My wife is hacking on medical research
  • No beers in the fridge

Versions

Version
2.1.0
2.0.0
1.1.0
1.0.0