Class SystemdLifecycle

java.lang.Object
com.github.jpmsilva.jsystemd.SystemdLifecycle
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class SystemdLifecycle extends Object implements org.springframework.context.SmartLifecycle
Implementation of SmartLifecycle that logs systemd integration status on startup, and sends a stopping signal when the application is shutting down.
Author:
Joao Silva
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance using the provided Systemd as the integration point.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.SmartLifecycle

    getPhase, isAutoStartup, stop
  • Constructor Details

    • SystemdLifecycle

      public SystemdLifecycle(Systemd systemd)
      Creates a new instance using the provided Systemd as the integration point.
      Parameters:
      systemd - the Systemd to send status information to
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle