I've written a standalone Java (console) application that runs in a cycle of:
- Check a database for new tasks to perform
- Perform the tasks
- Update the database with the results
- Sleep for n minutes before waking up to repeat the above
So, it's basically a daemon running in the background. I'd like to add the ability to ask the application, "Hey app, what are you working on right now? Can you give details on your current task? etc.". Ideally, the app would have an easy way to query it for its state, but I'm not sure how to add this. I've looked at Restlet, and considered signal handling, but I'm looking for suggestions from others.
I'm not looking at logging right now since the log files could get very large, and it would be great if the app only generated the info on demand instead of always generating it (I'd like to minimize the impact of this feature on the app's performance).
Has anyone else tried doing this, or have recommendations to make? Thanks in advance.