操作系统:Windows 7 JVM:JavaSE 1.7 Java EE:JBoss AS 7.1.1
设想:
@Path("/test")
@RequestScoped
public class TestService {
@Inject
private Instance<Dummy> dummyinInstance;
@Path("/execute")
@GET
public void execute() {
dummyinInstance.get().execute();
}
}
@Stateless
public class Dummy {
private Date date=new Date();
public void execute() {
System.out.println("current date="+date);
}
}
当我远程执行(使用休息客户端)Teservice:执行多次时,会打印相同的日期。