/** * All proprietary Comet based {@link Servlet} must invoke the resume * method when the Atmosphere's application decide to resume the {@link HttpServletResponse}. * The returned value, of type * {@link Atmosphere#Action}, tells the proprietary Comet {@link Servlet} * to resume (again), suspended or do nothing with the current {@link HttpServletResponse}. * * @param req the {@link HttpServletRequest} * @param res the {@link HttpServletResponse} * @return action the Action operation. */ public Action resumed(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException{ if (logger.isLoggable(Level.FINE)){ logger.fine("(resumed) invoked:\n HttpServletRequest: " + req + "\n HttpServletResponse: " + res); } return action(req, res); }
/** * All proprietary Comet based {@link Servlet} must invoke the suspended * method when the first request comes in. The returned value, of type * {@link Atmosphere#Action}, tells the proprietary Comet {@link Servlet} * to suspended or not the current {@link HttpServletResponse}. * * @param req the {@link HttpServletRequest} * @param res the {@link HttpServletResponse} * @return action the Action operation. */ public Action suspended(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException{ if (logger.isLoggable(Level.FINE)){ logger.fine("(suspend) invoked:\n HttpServletRequest: " + req + "\n HttpServletResponse: " + res); } return action(req, res); }
/** * {@inheritDoc} */ @Override public void action(AtmosphereResourceImpl actionEvent) { super.action(actionEvent); if (actionEvent.isInScope() && actionEvent.action().type() == Action.TYPE.RESUME) { try { RequestResponseKey rrk = (RequestResponseKey) actionEvent.getRequest().getSession().getAttribute(RRK); AbstractAsyncServlet.notify(rrk, null); } catch (IOException ex) { logger.debug("action failed", ex); } } }