/* */ private void handleEvent(Event paramEvent) /* */ { /* 266 */ ExchangeImpl localExchangeImpl = paramEvent.exchange; /* 267 */ HttpConnection localHttpConnection = localExchangeImpl.getConnection(); /* */ try { /* 269 */ if ((paramEvent instanceof WriteFinishedEvent)) /* */ { /* 271 */ int i = ServerImpl.this.endExchange(); /* 272 */ if ((ServerImpl.this.terminating) && (i == 0)) { /* 273 */ ServerImpl.this.finished = true; /* */ } /* 275 */ ServerImpl.this.responseCompleted(localHttpConnection); /* 276 */ LeftOverInputStream localLeftOverInputStream = localExchangeImpl.getOriginalInputStream(); /* 277 */ if (!localLeftOverInputStream.isEOF()) { /* 278 */ localExchangeImpl.close = true; /* */ } /* 280 */ if ((localExchangeImpl.close) || (ServerImpl.this.idleConnections.size() >= ServerImpl.MAX_IDLE_CONNECTIONS)) { /* 281 */ localHttpConnection.close(); /* 282 */ ServerImpl.this.allConnections.remove(localHttpConnection); /* */ } /* 284 */ else if (localLeftOverInputStream.isDataBuffered()) /* */ { /* 286 */ ServerImpl.this.requestStarted(localHttpConnection); /* 287 */ handle(localHttpConnection.getChannel(), localHttpConnection); /* */ } else { /* 289 */ this.connsToRegister.add(localHttpConnection); /* */ } /* */ } /* */ } /* */ catch (IOException localIOException) { /* 294 */ ServerImpl.this.logger.log(Level.FINER, "Dispatcher (1)", localIOException); /* */ /* 297 */ localHttpConnection.close(); /* */ } /* */ }
public void close() throws IOException { if (closed) { return; } closed = true; flush(); LeftOverInputStream is = t.getOriginalInputStream(); if (!is.isClosed()) { try { is.close(); } catch (IOException e) { } } WriteFinishedEvent e = new WriteFinishedEvent(t); t.getHttpContext().getServerImpl().addEvent(e); }
public String getProtocol() { return impl.getProtocol(); }
public InetSocketAddress getLocalAddress() { return impl.getLocalAddress(); }
public InetSocketAddress getRemoteAddress() { return impl.getRemoteAddress(); }
public void sendResponseHeaders(int rCode, long contentLen) throws IOException { impl.sendResponseHeaders(rCode, contentLen); }
public OutputStream getResponseBody() { return impl.getResponseBody(); }
public void setStreams(InputStream i, OutputStream o) { impl.setStreams(i, o); }
public void close() { impl.close(); }
public HttpContextImpl getHttpContext() { return impl.getHttpContext(); }
public String getRequestMethod() { return impl.getRequestMethod(); }
public URI getRequestURI() { return impl.getRequestURI(); }
public Headers getResponseHeaders() { return impl.getResponseHeaders(); }
public Headers getRequestHeaders() { return impl.getRequestHeaders(); }
public Object getAttribute(String name) { return impl.getAttribute(name); }
public void setAttribute(String name, Object value) { impl.setAttribute(name, value); }
public InputStream getRequestBody() { return impl.getRequestBody(); }
public HttpPrincipal getPrincipal() { return impl.getPrincipal(); }
public int getResponseCode() { return impl.getResponseCode(); }