title: Capture Windows shutdown, log off and restart in Windows service built in Java?
body: <p>Is there a way to catch a Windows log off or/and shutdown event in a Windows service built in Java? </p>
  
  <p>I want to capture windows event in a Windows service and after capturing I want to send an mail.</p>