public void doClose() throws IOException{ event.close(); } });
public void doClose() throws IOException { event.close(); } });
public void doClose() throws IOException { onSocketClosed((WebSocket) request.getAttribute(SESSION_WEBSOCKET_HANDLE)); event.close(); } });
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 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 void close() { HttpEvent event = this.event.getAndSet(null); if (event != null) { try { event.close(); } catch (Exception e) { log.debug(e, "Could not close event: %s for channel: %s", EventUtil.toString(event), this); } } } }
/** * {@inheritDoc} */ public void action(AtmosphereEventImpl actionEvent) { if (actionEvent.action().type == Action.TYPE.RESUME){ try { HttpEvent event = (HttpEvent) actionEvent.getRequest().getAttribute(HTTP_EVENT); resumed.offer(event); event.close(); } catch (IOException ex) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE,"",ex); } } } }
private void endEvent(HttpEvent cometEvent) throws IOException, ServletException { HttpServletRequest request = cometEvent.getHttpServletRequest(); log.debug("END: " + request.getSession() + '\n'); final Pushable pushable = getPushable(request); if (pushable != null) pushable.reset(); cometEvent.close(); }
private void handleTimeout(HttpEvent cometEvent) throws IOException, ServletException { HttpServletRequest request = cometEvent.getHttpServletRequest(); log.error("TIMEOUT: " + request.getSession() + '\n'); final Pushable pushable = getPushable(request); if (pushable != null) { synchronized (pushable) { pushable.reset(); pushable.reconnect(); } } cometEvent.close(); }
@Override protected void releaseAsyncHttpContext(AsyncHttpContext context) { try { if (context != null && context.getObject() != null) ((HttpEvent)context.getObject()).close(); } catch (Exception e) { log.debug(e, "Could not release event for channel: %s", this); } }
/** * Perform the filtering that has been configured for this Filter, matching * against the specified request property. * * @param property The property to check against the allow/deny rules * @param event The comet event to be filtered * @param chain The comet filter chain * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ protected void processCometEvent(String property, HttpEvent event, HttpEventFilterChain chain) throws IOException, ServletException { HttpServletResponse response = event.getHttpServletResponse(); if (isAllowed(property)) { chain.doFilterEvent(event); } else { response.sendError(HttpServletResponse.SC_FORBIDDEN); event.close(); } }
/** * Perform the filtering that has been configured for this Filter, matching * against the specified request property. * * @param property The property to check against the allow/deny rules * @param event The comet event to be filtered * @param chain The comet filter chain * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ protected void processCometEvent(String property, HttpEvent event, HttpEventFilterChain chain) throws IOException, ServletException { HttpServletResponse response = event.getHttpServletResponse(); if (isAllowed(property)) { chain.doFilterEvent(event); } else { response.sendError(HttpServletResponse.SC_FORBIDDEN); event.close(); } }
protected void end(HttpEvent event) throws IOException, ServletException { boolean close = true; try { close = handleEnd(event); } finally { if (close) { try { event.close(); } catch (Exception e) { log.debug(e, "Could not close event: %s", EventUtil.toString(event)); } } } }
public void event(HttpEvent cometEvent) throws IOException, ServletException { HttpEvent.EventType type = cometEvent.getType(); if (log.isTraceEnabled()) { log.trace("["+Thread.currentThread().getName()+"] Received Comet Event type="+type); } switch (type) { case BEGIN: cometEvent.setTimeout(getTimeout()); break; case READ: checkBayeux(cometEvent); break; case EOF: case EVENT: case WRITE: break; case ERROR: case END: case TIMEOUT: tb.remove(cometEvent); cometEvent.close(); break; } }//event
protected void error(HttpEvent event) throws IOException, ServletException { boolean close = true; try { close = handleError(event); } finally { if (close) { try { event.close(); } catch (Exception e) { log.debug(e, "Could not close event: %s", EventUtil.toString(event)); } } } }
public void event(HttpEvent cometEvent) throws IOException, ServletException { HttpEvent.EventType type = cometEvent.getType(); if (CoyoteLogger.BAYEUX_LOGGER.isTraceEnabled()) { CoyoteLogger.BAYEUX_LOGGER.trace("["+Thread.currentThread().getName()+"] Received Comet Event type="+type); } switch (type) { case BEGIN: cometEvent.setTimeout(getTimeout()); break; case READ: checkBayeux(cometEvent); break; case EOF: case EVENT: case WRITE: break; case ERROR: case END: case TIMEOUT: tb.remove(cometEvent); cometEvent.close(); break; } }//event
previousEvent.close();
protected void begin(HttpEvent event) throws IOException, ServletException { boolean close = true; try { // Event timeout isn't supported with APR connectors... if (longPollingTimeoutSupported) { try { event.setTimeout((int)getLongPollingTimeout()); } catch (Exception e) { longPollingTimeoutSupported = false; } } HttpServletRequest request = event.getHttpServletRequest(); CometIO io = createCometIO(); io.readFully(request.getInputStream()); close = handleRequest(event, io.getInputStream()); } finally { if (close) { try { event.close(); } catch (Exception e) { log.debug(e, "Could not close event: %s", EventUtil.toString(event)); } } } }
if (context == null) { try { event.close();