[jboss-user] [JBoss Seam] - Re: @Startup not working
javabr
do-not-reply at jboss.com
Tue May 22 11:40:57 EDT 2007
Hi,
It is working for me: (take a loog on @Create)
| @Startup(depends="manager")
| @Name("controller")
| @Scope(ScopeType.APPLICATION)
| public class Controller {
|
| @In(create=true)
| private Manager manager;
|
| @Create
| public void create() throws Exception {
| manager.schedule();
| }
| }
|
| @Name("manager")
| @Scope(ScopeType.APPLICATION)
| public class Manager {
|
| private static Date MIDNIGHT = null;
|
| @In(create = true)
| Job sendNotificationsToScheduledTasks;
|
| public void schedule() {
| Calendar calendar = GregorianCalendar.getInstance();
| calendar.set(Calendar.HOUR_OF_DAY, 0);
| calendar.set(Calendar.MINUTE, 1);
| calendar.set(Calendar.SECOND, 1);
| MIDNIGHT = calendar.getTime();
| System.out.print(MIDNIGHT);
| sendNotificationsToScheduledTasks.execute(MIDNIGHT, Frequency.DAILY.getInterval());
| }
|
I also had must to take the jboss timer off.
rgds
Leo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047627#4047627
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047627
More information about the jboss-user
mailing list