title: Integrate REST API with glassfish
body: <p>I have an application that runs on glassfish server. This application has a background thread that will run until the application is shutdown.
  I want to create a REST API that can call the destroy method for the background thread so that the background thread will shut down upon getting a GET request from outside the application. How can I integrate this REST API with the glassfish server ?</p>