在我的 spring 3 控制器中执行以下方法期间,我收到错误(AtmosphereResource 类型不是通用的;它不能用参数参数化)。
@RequestMapping(value="/websockets", method=RequestMethod.GET)
@ResponseBody
public void websockets(final AtmosphereResource<HttpServletRequest,HttpServletResponse> event) {
final HttpServletRequest req = event.getRequest();
final HttpServletResponse res = event.getResponse();
event.suspend();
final Broadcaster bc = event.getBroadcaster();
bc.scheduleFixedBroadcast(new Callable<String>() {
public String call() throws Exception {
return (new Date()).toString();
}
}, 11, TimeUnit.SECONDS);
}