FileDocCategorySizeDatePackage
ExampleTimerBean.javaAPI DocJBoss 4.2.11829Fri Jul 13 20:55:00 BST 2007org.jboss.tutorial.timer.bean

ExampleTimerBean

public class ExampleTimerBean extends Object implements ExampleTimer

Fields Summary
private javax.ejb.SessionContext
ctx
Constructors Summary
Methods Summary
public voidscheduleTimer(long milliseconds)

      ctx.getTimerService().createTimer(new Date(new Date().getTime() + milliseconds), "Hello World");
   
public voidtimeoutHandler(javax.ejb.Timer timer)

      System.out.println("---------------------");
      System.out.println("* Received Timer event: " + timer.getInfo());
      System.out.println("---------------------");

      timer.cancel();