定时器

  1. 在netBeans中可以直接右键创建定时器回话bean:

    类上的注解:@Stateless @LocalBean

        需要执行的方法上的注解:@Schedule(dayOfWeek = "Mon-Fri", month = "*", hour = "9-17", dayOfMonth = "*", year = "*", minute = "*", second = "*")

        填入相应的参数,设置方法的执行时间。

2.       http://docs.oracle.com/javaee/5/tutorial/doc/bnboy.html#bnbpe 

3.    javaee6 定时器 api:http://docs.oracle.com/javaee/6/api/javax/ejb/Schedule.html 

Increments. The forward slash constrains an attribute based on a starting point and an interval, and is used to specify every N seconds, minutes, or hours within the minute, hour, or day, respectively. For the expression x/y, the attribute is constrained to every yth value within the set of allowable values beginning at time x. The x value is inclusive. The wild card character (*) can be used in the x position, and is equivalent to 0

你可能感兴趣的:(定时器)