public void setIdleTimeoutDelay(long idleTimeoutDelay) { this.idleTimeoutDelay = validateIdleTimeoutDelay(idleTimeoutDelay); SuspendResponseUtils.updateIdleTimeOutDelay(response.selectionKey, response.getResponseAttachment()); }
/** * {@inheritDoc} */ public boolean isSupportFileSend() { return ((FileOutputBuffer)response.getOutputBuffer()).isSupportFileSend(); }
public long getRequestBytesSent() { return req.getResponse().getBytesWritten(); }
/** * {@inheritDoc} */ public long sendFile(FileChannel fileChannel, long position, long length) throws IOException { return ((FileOutputBuffer)response.getOutputBuffer()).sendFile(fileChannel, position, length); }
public void setGlobalProcessor(RequestGroupInfo global) { if( global != null) { this.global=global; global.addRequestProcessor( this ); } else { if (this.global != null) { this.global.removeRequestProcessor( this ); this.global = null; } } }
/** * Return the server port responding to this Request. */ public int getServerPort() { return (request.getServerPort()); }
/** * Return the current WorkerThread ID associated with this instance. */ public long getWorkerThreadID(){ return request.getRequestProcessor().getWorkerThreadID(); }
/** * Write all headers into our internal buffer but don't flush them to the * client yet. You must invoke {@link #flush} in order to make that operation. */ public void sendHeaders() throws IOException { action(ActionCode.ACTION_COMMIT, this); commited = true; }
/** * Read the content length from the request. */ public void setRequest(Request request) { contentLength = request.getContentLengthLong(); remaining = contentLength; }
public void setCharacterEncoding(String charset) { if (isCommitted()) return; if (charset == null) return; characterEncoding = charset; // START SJSAS 6316254 quotedCharsetValue = charset; // END SJSAS 6316254 charsetSet=true; }
/** * Return the content type for this Request. */ public String getContentType() { return (request.getContentType()); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. */ public void suspend(){ suspend(Long.MAX_VALUE); }
protected ResponseAttachment(long idleTimeoutDelay, A attachment, CompletionHandler<? super A> completionHandler, Response response) { this.attachment = attachment; this.completionHandler = completionHandler; this.response = response; this.idleTimeoutDelay = validateIdleTimeoutDelay(idleTimeoutDelay); }
/** * Return the current WorkerThread ID associated with this instance. */ public long getWorkerThreadID(){ return request.getRequestProcessor().getWorkerThreadID(); }
/** * Write all headers into our internal buffer and flush the to the client. */ public void flushHeaders() throws IOException { action(ActionCode.ACTION_COMMIT, this); commited = true; }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. */ public void suspend(){ suspend(Long.MAX_VALUE); }