public static boolean isValid(HttpEvent event) { if (event != null) { try { return event.getHttpServletRequest() != null && event.getHttpServletResponse() != null; } catch (Exception e) { } } return false; }
/** * Return the servlet request for which this event occurred. */ public ServletRequest getRequest() { if (event != null) { return this.event.getHttpServletRequest(); } else { return (this.request); } }
/** * Return the servlet response for which this event occurred. */ public ServletResponse getResponse() { if (event != null) { return this.event.getHttpServletResponse(); } else { return (this.response); } }
protected void addCometEvent(HttpEvent event) { if (this.event != null) { try { this.event.close(); } catch (IOException e) { // Nothing } } this.event = event; event.getHttpServletRequest().setAttribute(COMET_EVENT_ATTR,this); }
public static boolean isTimeout(HttpEvent event) { return (event.getType() == EventType.TIMEOUT); }
public void doClose() throws IOException{ event.close(); } });
public void sendUpgrade() throws IOException { ((UpgradableHttpServletResponse) response).sendUpgrade(); } };
public void startUpgrade() { ((UpgradableHttpServletResponse) response).startUpgrade(); }
protected void addCometEvent(HttpEvent event) { if (this.event != null) { try { this.event.close(); } catch (IOException e) { // Nothing } } this.event = event; event.getHttpServletRequest().setAttribute(COMET_EVENT_ATTR,this); }
protected void removeCometEvent(HttpEvent event) { if (this.event != null && this.event == event) { this.event = null; } event.getHttpServletRequest().removeAttribute(COMET_EVENT_ATTR); }
public static boolean isErrorButNotTimeout(HttpEvent event) { return event.getType() == EventType.ERROR; }
public void doClose() throws IOException { event.close(); } });
public void sendUpgrade() throws IOException { ((UpgradableHttpServletResponse) response).sendUpgrade(); } };
public void startUpgrade() { ((UpgradableHttpServletResponse) response).startUpgrade(); }
protected void removeCometEvent(HttpEvent event) { if (this.event != null && this.event == event) { this.event = null; } event.getHttpServletRequest().removeAttribute(COMET_EVENT_ATTR); }
public int process(int prevops) throws BayeuxException { event.getHttpServletRequest().setAttribute(CURRENT_REQ_ATTR,this); return prevops; }
public int process(int prevops) throws BayeuxException { event.getHttpServletRequest().setAttribute(CURRENT_REQ_ATTR,this); return prevops; }
protected ClientImpl getClientImpl(HttpEvent event) { return (ClientImpl)event.getHttpServletRequest().getAttribute(ClientImpl.COMET_EVENT_ATTR); }
protected ClientImpl getClientImpl(HttpEvent event) { return (ClientImpl)event.getHttpServletRequest().getAttribute(ClientImpl.COMET_EVENT_ATTR); }