Is there a best-practice for the follwing case:
1. EJB should poll all 5 minutes a file (or whatever)
2. send the file to JMS (or whatever)
my solution:
1. Create Session Bean
2. Deploy Session Bean
3. Create Client that calls Session bean with Method START_FIRST_TIME()
4. Session Bean registers Timer
5. Timer calls session bean DO_THE_WORK() all 5 minutes
From now on it works fine independent as long as Jboss is running (because timers are persistent and survives shutdowns)
So I need step 2 and 3 one ONE time. That is ugly.
Any better suggestion (as long as we keep in EJB Standard)?
Any Mbean service available that can do this by configuration ?
An mbean or a servlet that will call your EJB at deployment time. I don't think there is something declarative you could just re-use.