daemon

Class that implements a reload hook via SIGHUP

License

License

GroupId

GroupId

com.spotify
ArtifactId

ArtifactId

daemon
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

daemon
Class that implements a reload hook via SIGHUP
Project URL

Project URL

https://github.com/spotify/daemon-java
Source Code Management

Source Code Management

https://github.com/spotify/daemon-java

Download daemon

How to add to project

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

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Java classes that implements reload on SIGHUP

This minimal library is essentially a way to encapsulate the somewhat non-portable way in which a handler for the SIGHUP Unix signal can be installed. The following code

MainLoop ml = MainLoop.newInstance();
ml.installReloadHandler(onReload);
ml.run();

will install the onReload handler and then wait around until the process is told to exit by sending SIGTERM.

This library uses non-standard functionality, i.e. sun.misc.Signal, that might not be available in Java everywhere. Additionally the unit test assumes that there is a kill command that can be executed on the host system to signal the current process.

License

This software is released under the Apache License 2.0. More information in the file LICENSE distributed with this project.

com.spotify

Spotify

Versions

Version
1.2.0