org.eclipse.jetty.http
类 AbstractGenerator
java.lang.Object
org.eclipse.jetty.http.AbstractGenerator
- 所有已实现的接口:
- Generator
- 直接已知子类:
- Ajp13Generator, HttpGenerator, NestedGenerator
public abstract class AbstractGenerator
- extends Object
- implements Generator
Abstract Generator. Builds HTTP Messages.
Currently this class uses a system parameter "jetty.direct.writers" to control
two optional writer to byte conversions. buffer.writers=true will probably be
faster, but will consume more memory. This option is just for testing and tuning.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STATE_HEADER
public static final int STATE_HEADER
- 另请参见:
- 常量字段值
STATE_CONTENT
public static final int STATE_CONTENT
- 另请参见:
- 常量字段值
STATE_FLUSHING
public static final int STATE_FLUSHING
- 另请参见:
- 常量字段值
STATE_END
public static final int STATE_END
- 另请参见:
- 常量字段值
NO_BYTES
public static final byte[] NO_BYTES
_buffers
protected final Buffers _buffers
_endp
protected final EndPoint _endp
_state
protected int _state
_status
protected int _status
_version
protected int _version
_reason
protected Buffer _reason
_method
protected Buffer _method
_uri
protected String _uri
_contentWritten
protected long _contentWritten
_contentLength
protected long _contentLength
_last
protected boolean _last
_head
protected boolean _head
_noContent
protected boolean _noContent
_persistent
protected Boolean _persistent
_header
protected Buffer _header
_buffer
protected Buffer _buffer
_content
protected Buffer _content
_date
protected Buffer _date
AbstractGenerator
public AbstractGenerator(Buffers buffers,
EndPoint io)
- Constructor.
- 参数:
buffers - buffer poolio - the end point
isRequest
public abstract boolean isRequest()
isResponse
public abstract boolean isResponse()
isOpen
public boolean isOpen()
reset
public void reset()
- 指定者:
- 接口
Generator 中的 reset
returnBuffers
public void returnBuffers()
- 指定者:
- 接口
Generator 中的 returnBuffers
resetBuffer
public void resetBuffer()
- 指定者:
- 接口
Generator 中的 resetBuffer
getContentBufferSize
public int getContentBufferSize()
- 指定者:
- 接口
Generator 中的 getContentBufferSize
- 返回:
- Returns the contentBufferSize.
increaseContentBufferSize
public void increaseContentBufferSize(int contentBufferSize)
- 指定者:
- 接口
Generator 中的 increaseContentBufferSize
- 参数:
contentBufferSize - The contentBufferSize to set.
getUncheckedBuffer
public Buffer getUncheckedBuffer()
getSendServerVersion
public boolean getSendServerVersion()
setSendServerVersion
public void setSendServerVersion(boolean sendServerVersion)
- 指定者:
- 接口
Generator 中的 setSendServerVersion
getState
public int getState()
isState
public boolean isState(int state)
isComplete
public boolean isComplete()
- 指定者:
- 接口
Generator 中的 isComplete
isIdle
public boolean isIdle()
- 指定者:
- 接口
Generator 中的 isIdle
isCommitted
public boolean isCommitted()
- 指定者:
- 接口
Generator 中的 isCommitted
isHead
public boolean isHead()
- 返回:
- Returns the head.
setContentLength
public void setContentLength(long value)
- 指定者:
- 接口
Generator 中的 setContentLength
setHead
public void setHead(boolean head)
- 指定者:
- 接口
Generator 中的 setHead
- 参数:
head - The head to set.
isPersistent
public boolean isPersistent()
- 指定者:
- 接口
Generator 中的 isPersistent
- 返回:
false if the connection should be closed after a request has been read,
true if it should be used for additional requests.
setPersistent
public void setPersistent(boolean persistent)
- 指定者:
- 接口
Generator 中的 setPersistent
setVersion
public void setVersion(int version)
- 指定者:
- 接口
Generator 中的 setVersion
- 参数:
version - The version of the client the response is being sent to (NB. Not the version
in the response, which is the version of the server).
getVersion
public int getVersion()
setDate
public void setDate(Buffer timeStampBuffer)
- 指定者:
- 接口
Generator 中的 setDate
- 另请参见:
Generator.setDate(org.eclipse.jetty.io.Buffer)
setRequest
public void setRequest(String method,
String uri)
- 指定者:
- 接口
Generator 中的 setRequest
setResponse
public void setResponse(int status,
String reason)
- 指定者:
- 接口
Generator 中的 setResponse
- 参数:
status - The status code to send.reason - the status message to send.
prepareUncheckedAddContent
public abstract int prepareUncheckedAddContent()
throws IOException
- Prepare buffer for unchecked writes.
Prepare the generator buffer to receive unchecked writes
- 返回:
- the available space in the buffer.
- 抛出:
IOException
completeUncheckedAddContent
public void completeUncheckedAddContent()
isBufferFull
public boolean isBufferFull()
- 指定者:
- 接口
Generator 中的 isBufferFull
isWritten
public boolean isWritten()
- 指定者:
- 接口
Generator 中的 isWritten
isAllContentWritten
public boolean isAllContentWritten()
- 指定者:
- 接口
Generator 中的 isAllContentWritten
completeHeader
public abstract void completeHeader(HttpFields fields,
boolean allContentAdded)
throws IOException
- 指定者:
- 接口
Generator 中的 completeHeader
- 抛出:
IOException
complete
public void complete()
throws IOException
- Complete the message.
- 指定者:
- 接口
Generator 中的 complete
- 抛出:
IOException
flushBuffer
public abstract int flushBuffer()
throws IOException
- 指定者:
- 接口
Generator 中的 flushBuffer
- 抛出:
IOException
flush
public void flush(long maxIdleTime)
throws IOException
- 抛出:
IOException
sendError
public void sendError(int code,
String reason,
String content,
boolean close)
throws IOException
- Utility method to send an error response. If the builder is not committed, this call is
equivalent to a setResponse, addContent and complete call.
- 指定者:
- 接口
Generator 中的 sendError
- 参数:
code - The error codereason - The error reasoncontent - Contents of the error pageclose - True if the connection should be closed
- 抛出:
IOException - if there is a problem flushing the response
getContentWritten
public long getContentWritten()
- 指定者:
- 接口
Generator 中的 getContentWritten
- 返回:
- Returns the contentWritten.
blockForOutput
public void blockForOutput(long maxIdleTime)
throws IOException
- 抛出:
IOException
Copyright © 2013. All Rights Reserved.