0

for my EE application, i have to consider clustered timertasks in JBoss 6 Environment. The tasks must be persisted in the database. While application initialization,the tasks must be created and scheduled from these persisted entites.

For example, i have an entity like this:

class MyTask {
   private Long id;
   private String cronExpression;
   private String name;
}

I can create new Jobs and CronTriggers using Quartz and using data sources, i can let them synced over cluster instances. But, what is the best strategy in JBoss Environment using EJBs?

Using Java EE facilities under "http://download.oracle.com/javaee/6/tutorial/doc/bnboy.html" i could use @Schedule annotation with cron expressions. But my Job must be created dynamically from entity objects at runtime. How should my bean seem?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Erhan Bagdemir
  • 5,231
  • 6
  • 34
  • 40

1 Answers1

1

Use the TimerService directly to programmatically create a timer rather than using @Schedule to automatically create one.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
  • thanks for your answer. which strategy can i use on JBoss environment to cluster my timer service on whole farm? – Erhan Bagdemir May 06 '11 at 06:59
  • The EJB spec requires that timers only fire once in a clustered environment, but I don't know the specifics for JBoss. (Sorry, I didn't notice this was a JBoss-specific question.) – Brett Kail May 06 '11 at 15:22