users@glassfish.java.net

Re: how to auto start TimerService EJB?

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 May 2010 07:50:46 PDT

Yes, this feature was added in EJB 3.1 so you'll need GlassFish v3. Just add the @Schedule annotation to the method you'd like to be called for each timer expiration. For example :

// Every five minutes within the hour
@Schedule(minute=”*/5”, hour=”*”)
public void timeout() { ... }

“Every Monday, Wednesday, and Friday at 30 seconds past noon”
@Schedule(second=”30”, hour=”12”, dayOfWeek=”Mon,Wed,Fri”)
public void timeout() { ... }
[Message sent by forum member 'ksak']

http://forums.java.net/jive/thread.jspa?messageID=469378