I want to make web application that will utilize pretty much cpu and memory on server.
The goal is to control multi-threaded time consuming server side precessing via web user interface (that processing can last a few hours).
That server side processing will fetch some data from Internet and do some processing with it.
Processed data will be stored in MySQL database for latter usage and reporting.
My plan is to use Java Server Faces, ejbs, with glassfish to configure, execute and at some point split processing over multiple machines.
I have tried to use @Stateless @Asynchronous WorkerBean which was accessed via servlet to start calculation asynchronous. The method that starts calculation returns Future object.
Calculation work as expected in its own thread and finishes fine.
What I need is some kind of status retrieval form WorkerBean. Is there a way I can access that WorkerBean for progress tracking, stopping, etc?
Things become more complicated because application should be able to control more than one WorkerBean via web user interface.
WorkerBean is able to access database so that is an alternative way of communicating with that process, but It is looking to me more like workaround.
I would recommend you to use lightfish (http://lightfish.adam-bien.com/) or the same API that Lightfish use to query the Glassfish container. Another suggestions: IMO, i think it would be better use MDB instead of the Session Beans; Also I would create a different kind of solution depending the requirements (e.g. if you need to process tons of web pages and for long running operations, it would need to change the architecture, but only if it needs, otherwise it is better keeping the architecture as it is now).