views:

190

answers:

1

I need a way to have a session bean's method executed periodically every week at a certain time. I am thinking of using the quartz scheduler to do this. My question is, how do I start the scheduler to run from the moment the .ear file is deployed automatically? Is there any annotation that I can use on the stateless session bean calling the scheduler.start method such as @PostConstruct or something?

A: 

The problem with @PostConstruct for a stateless bean is that something has to trigger the bean to be constructed.

There's no standard way to do what you're trying to do until EJB 3.1 (automatic timers or startup singleton session beans). Until then, you could use a dummy WAR with a ServletContextListener to set up your EJB timer.

bkail