posted 10 years ago
I once had a system which on worst-case days could take 18 hours to do a run.
You don't want to embed something like this in a webapp server, It holds the server hostage. If, for any reason, you need to restart the webapp server when a long-running process is in operation, that means you have only 2 choices: 1) kill the long-running process or 2) delay restarting the webapp server until the long-running process ends.
At the time I set up my long-running process, options were probably more limited, so what I did was construct a standalone RMI server to hold it. The webapp did RMI calls to monitor and control the process. There was no need of a web services interface, since normally the only way that the processor would be communicated with was via the GUI in the webapp. Had I needed an external control service, I could also simply make RMI calls directly.
These days I'd probably host the process in an application container such as the Apache felix/karaf/servicemix stack. These containers can not only hold offline apps, they can provide control/monitor/data interfaces using mechanisms like JMS or even act as web services hosts themselves. Plus I could implement the process as an OSGi bundle if I wanted.
The problem with getting rid of the "undesirables" is that sooner or later someone will decide that YOU are an undesirable.