Does application scoped beans run on seperate thread in JSF? -


i using jsf create web app.

i have application scoped bean has infinite loop periodically performs action.

my problem bean (due infinite loop) blocking whole application. thought bean run on own thread. isnt case jsf, each managed bean running on own thread default?

should create thread , let infinite loop run in thread instead?

thank

does application scoped beans run on seperate thread in jsf?

no, doesn't.

should create thread , let infinite loop run in thread instead?

no, shouldn't. should create scheduled task. best way use @singleton @schedule ejb.

@singleton public class somedailyjob {      @schedule(hour="0", minute="0", second="0", persistent=false)     public void run() {         // job here should run daily @ midnight.     }  }  

that's all. no additional configuration of manually messing threads necessary. if want access state -if any- in jsf managed bean, inject @ejb usual way.

see also:


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -