1

I have this scenario which I am planning to implement in Java EE on JBOSS.

I wish for a user to log into an application, be able to start a long running process, log out and be able to log back into the application and get/alter the state of the running process.

I am not concerned with the user login but need advice on what sort of bean should I be using for my long running process. I have read on Singletons and Stateless / Statefull Session Beans (most likely not enough), but they don't appear to fit what I need. Is there any advice or can someone point me in the right direction of what I should use to implement the above use case.

Thanks

1 Answers1

0

For long running tasks you can use Commonj Work Managers API on JBoss, check this thread Using a CommonJ implementation with GlassFish and Spring 3 and the implementation of the API http://commonj.myfoo.de. I think you don't need to save the state of everything, you can create a mechanism for identifying the tasks asociated to a user, so you'll just show the status of the tasks filtered by the username. EJBs are very usefull to write business logic, just avoid statefull stuff, use it only when it is really necesary.

Community
  • 1
  • 1
Rafael Guillen
  • 1,343
  • 10
  • 25
  • I hadn't intended on maintaining state of everything. Just need to ensure that the long running processes state is retrievable after log out/ log in and to ensure that unless otherwise stopped, the process (or newly created processes) will continue to run as long as the server is up. I will look into JBoss Work Managers. –  Nov 14 '14 at 09:30