I have a
JSP page that allows the users to send a fax (scheduled and processed on another machine). The users want an email confirmation when their fax is done. So, when the user submits at fax, I give the fax to a FaxMonitor class that periodically checks the fax's status. When it is done, it sends an email to the user.
The FaxMonitor is Runnable and presently expects external code to put it in a
Thread and start it. This could be changed to where it's constructor could do this.
I would like there to be one and only one instance of the FaxMonitor. It should be created either on startup or on first use. Once created, it should hang around virtually forever.
I'd like the one instance to be in the same JVM as the
servlets so that I don't need to Serialize/Remote my code.
How should I do this?