Exemplo n.º 1
0
/*     */     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();
 }
Exemplo n.º 10
0
 public HttpContextImpl getHttpContext() {
   return impl.getHttpContext();
 }
Exemplo n.º 11
0
 public String getRequestMethod() {
   return impl.getRequestMethod();
 }
Exemplo n.º 12
0
 public URI getRequestURI() {
   return impl.getRequestURI();
 }
Exemplo n.º 13
0
 public Headers getResponseHeaders() {
   return impl.getResponseHeaders();
 }
Exemplo n.º 14
0
 public Headers getRequestHeaders() {
   return impl.getRequestHeaders();
 }
Exemplo n.º 15
0
 public Object getAttribute(String name) {
   return impl.getAttribute(name);
 }
Exemplo n.º 16
0
 public void setAttribute(String name, Object value) {
   impl.setAttribute(name, value);
 }
Exemplo n.º 17
0
 public InputStream getRequestBody() {
   return impl.getRequestBody();
 }
Exemplo n.º 18
0
 public HttpPrincipal getPrincipal() {
   return impl.getPrincipal();
 }
Exemplo n.º 19
0
 public int getResponseCode() {
   return impl.getResponseCode();
 }