Hi,
Who knows how to use jboss annotation ? when I got samples from jboss tutorial, and populate to MyEclipse, errors displayed with them.
One sample as below:
package org.jboss.tutorial.timer.bean;
import java.util.Date;
import javax.annotation.Resource;
import javax.ejb.Remote;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
import javax.ejb.Timer;
@Stateless
@Remote(ExampleTimer.class)
public class ExampleTimerBean implements ExampleTimer
{
private @Resource SessionContext ctx;
public void scheduleTimer(long milliseconds)
{
ctx.getTimerService().createTimer(new Date(new Date().getTime() + milliseconds), "Hello World");
}
@Timeout
public void timeoutHandler(Timer timer)
{
System.out.println("---------------------");
System.out.println("* Received Timer event: " + timer.getInfo());
System.out.println("---------------------");
timer.cancel();
}
}
Thanks in advance
Paul