使用NetBeans 7.1 / GlassFish 3.1,我创建了一个新的TimerSessionBean。
@Stateless
public class NewTimerSessionBean implements NewTimerSessionBeanLocal {
@Schedule(minute = "*", second = "0", dayOfMonth = "*", month = "*", year = "*", hour = "9-17", dayOfWeek = "Mon-Fri")
@Override
public void myTimer() {
System.out.println("Timer event: " + new Date());
}
}
如何声明计时器是非持久的? http://www.theserverside.com/news/1363578/EJB-31-A-Significant-Step-Towards-Maturity表示有一个方法isPersistent但它属于Timer接口。
在阅读本文中关于EJB计时器潜在问题的描述之后,我提出了这个问题:http://www.coderanch.com/t/477104/EJB-JEE/java/Java-EE-timer-service-periodical