java ee - EJB or Servlet - how to add a 'kill switch' to force a process/thread to stop -


The type of open question that I run once at a time - if you have EJB stateless or stateless bean, or Probably a direct subletting process, which can start running on the production system with the wrong parameters, how can you add manual 'kill switch' to kill that thread / process specifically for the administrator / person Are you

You can not, or at least do not interfere directly with the application server thread Should a "kill switch" definitely look unsuitable for me in a Java e e environment.

But I understand your problem, but instead suggest an asynchronous approach where you spend your job in small work units.

I used EJB Tires and was happy with the result: An initial timer for the first working unit has been created. When the app server executes the timer, then the other is registered as a working unit, etc. The information can pass a work unit in another form, because EJB timers support custom information storage. In addition, timer execution and registration transactions, which is okay to work with the database. You can separate the shutdown and the application from this perspective. Before the running of each working unit, we checked into the database if the job was canceled in the meantime.


Comments