Exemplo n.º 1
0
 @Override
 public void reportError(SelectionKey key, ErrorType e, String msg) throws IOException {
   String error = ErrorRespManager.getStringError(e, msg);
   BufferManager.resetBuffer(writeBufferWrapper.byteBuffer);
   BufferManager.addStringToBuffer(error, writeBufferWrapper);
   key.interestOps(SelectionKey.OP_WRITE);
   ((AttachmentHTTP) (key.attachment())).fullWrittenBuffer = true;
   LoggingManager.logReport("RESP - " + e.toString());
 }
Exemplo n.º 2
0
 @Override
 public void finishedReading(SelectionKey key) {
   ((AttachmentHTTP) serverChannel.keyFor(key.selector()).attachment()).fullWrittenBuffer = true;
   PoolClientConnectionManager.getInstance().removeClient(key);
   Statistics.getInstance().addMethod(httpRequest.getMethod());
   if (httpRequest.getHost() != null) {
     LoggingManager.logReport("REQ - " + httpRequest.getMethod() + " " + httpRequest.getHost());
   } else {
     LoggingManager.logError("REQ - " + httpRequest.getMethod() + " " + "Unkown host");
   }
 }