Class VmShutdownListener


  • public class VmShutdownListener
    extends java.lang.Object
    A class that keeps track of the VM shutdown status. It can be used by threads as a singleton to check if the VM shutdown status has been activated.

    NOTE: In order to prevent a proliferation of shutdown hooks, it is advisable to use instances as singletons only.

    This component should be used by long-running, but interruptable processes.

    Author:
    Derek Hulley
    • Constructor Summary

      Constructors 
      Constructor Description
      VmShutdownListener​(java.lang.String name)
      Constructs this instance to listen to the VM shutdown call.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isVmShuttingDown()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VmShutdownListener

        public VmShutdownListener​(java.lang.String name)
        Constructs this instance to listen to the VM shutdown call.
    • Method Detail

      • isVmShuttingDown

        public boolean isVmShuttingDown()
        Returns:
        Returns true if the VM shutdown signal was detected.