public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("["); if (isOpen()) { buffer.append(getRemotePort()); } else { buffer.append("closed"); } buffer.append("]"); return buffer.toString(); }
@Override protected void runInContext() { HttpContext context = new BasicHttpContext(null); try { while (!Thread.interrupted() && conn.isOpen()) { if (s_logger.isTraceEnabled()) s_logger.trace("dispatching cluster request from " + conn.getRemoteAddress().toString()); _httpService.handleRequest(conn, context); if (s_logger.isTraceEnabled()) s_logger.trace("Cluster request from " + conn.getRemoteAddress().toString() + " is processed"); } } catch (ConnectionClosedException ex) { // client close and read time out exceptions are expected // when KEEP-AVLIE is enabled s_logger.trace("Client closed connection", ex); } catch (IOException ex) { s_logger.trace("I/O error", ex); } catch (HttpException ex) { s_logger.error("Unrecoverable HTTP protocol violation", ex); } finally { try { conn.shutdown(); } catch (IOException ignore) { s_logger.error("unexpected exception", ignore); } } } });
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("["); if (isOpen()) { buffer.append(getRemotePort()); } else { buffer.append("closed"); } buffer.append("]"); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("["); if (isOpen()) { buffer.append(getRemotePort()); } else { buffer.append("closed"); } buffer.append("]"); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("["); if (isOpen()) { buffer.append(getRemotePort()); } else { buffer.append("closed"); } buffer.append("]"); return buffer.toString(); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("["); if (isOpen()) { buffer.append(getRemotePort()); } else { buffer.append("closed"); } buffer.append("]"); return buffer.toString(); }
@Override protected void runInContext() { final HttpContext context = new BasicHttpContext(null); try { while (!Thread.interrupted() && conn.isOpen()) { if (s_logger.isTraceEnabled()) { s_logger.trace("dispatching cluster request from " + conn.getRemoteAddress().toString()); } _httpService.handleRequest(conn, context); if (s_logger.isTraceEnabled()) { s_logger.trace("Cluster request from " + conn.getRemoteAddress().toString() + " is processed"); } } } catch (final ConnectionClosedException ex) { // client close and read time out exceptions are expected // when KEEP-AVLIE is enabled s_logger.trace("Client closed connection", ex); } catch (final IOException ex) { s_logger.trace("I/O error", ex); } catch (final HttpException ex) { s_logger.error("Unrecoverable HTTP protocol violation", ex); } finally { try { conn.shutdown(); } catch (final IOException ignore) { s_logger.error("unexpected exception", ignore); } } } });
@Override public void run() { DefaultHttpServerConnection conn = null; try { conn = new DefaultHttpServerConnection(); conn.bind(socket, params); HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry(); reqistry.register("*", new RequestHandlerImpl()); HttpService httpService = new HttpService(httpProcessor, crs, rf); httpService.setParams(params); httpService.setHandlerResolver(reqistry); while (!interrupted() && conn.isOpen()) { httpService.handleRequest(conn, new BasicHttpContext(null)); } } catch (Exception ex) { ex.printStackTrace(); } finally { try { conn.shutdown(); } catch (Exception ex) { ex.printStackTrace(); } } }