public class HTTP2Stream extends IdleTimeout implements StreamSPI, Callback
Stream.ListenerCallback.Completable, Callback.Nested, Callback.NonBlockingCHANNEL_ATTRIBUTE| 构造器和说明 |
|---|
HTTP2Stream(Scheduler scheduler,
SessionSPI session,
int streamId,
boolean local) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Forcibly closes this stream.
|
void |
data(DataFrame frame,
Callback callback)
Sends the given DATA
frame. |
void |
failed(Throwable x) |
Object |
getAttribute(String key) |
int |
getId() |
Stream.Listener |
getListener() |
int |
getRecvWindow() |
int |
getSendWindow() |
SessionSPI |
getSession() |
void |
headers(HeadersFrame frame,
Callback callback)
Sends the given HEADERS
frame representing a HTTP response. |
boolean |
isClosed() |
boolean |
isLocal() |
boolean |
isLocallyClosed() |
boolean |
isOpen() |
boolean |
isRemotelyClosed() |
boolean |
isReset() |
protected void |
onIdleExpired(TimeoutException timeout) |
void |
process(Frame frame,
Callback callback)
Processes the given
frame, belonging to this stream. |
void |
push(PushPromiseFrame frame,
Promise<Stream> promise,
Stream.Listener listener)
Sends the given PUSH_PROMISE
frame. |
Object |
removeAttribute(String key) |
void |
reset(ResetFrame frame,
Callback callback)
Sends the given RST_STREAM
frame. |
void |
setAttribute(String key,
Object value) |
void |
setListener(Stream.Listener listener) |
void |
succeeded() |
String |
toString() |
boolean |
updateClose(boolean update,
boolean local)
Updates the close state of this stream.
|
int |
updateRecvWindow(int delta)
Updates the stream receive window by the given
delta. |
int |
updateSendWindow(int delta)
Updates the stream send window by the given
delta. |
checkIdleTimeout, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, notIdle, onClose, onOpen, setIdleTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdleTimeout, setIdleTimeoutfrom, from, isNonBlockingpublic HTTP2Stream(Scheduler scheduler, SessionSPI session, int streamId, boolean local)
public boolean isLocal()
public SessionSPI getSession()
getSession 在接口中 StreamgetSession 在接口中 StreamSPIpublic void headers(HeadersFrame frame, Callback callback)
Stream
Sends the given HEADERS frame representing a HTTP response.
public void push(PushPromiseFrame frame, Promise<Stream> promise, Stream.Listener listener)
Stream
Sends the given PUSH_PROMISE frame.
public void data(DataFrame frame, Callback callback)
Stream
Sends the given DATA frame.
public void reset(ResetFrame frame, Callback callback)
Stream
Sends the given RST_STREAM frame.
public Object getAttribute(String key)
getAttribute 在接口中 Streamkey - the attribute keyStream.setAttribute(String, Object)public void setAttribute(String key, Object value)
setAttribute 在接口中 Streamkey - the attribute keyvalue - an arbitrary object to associate with the given key to this
streamStream.getAttribute(String),
Stream.removeAttribute(String)public Object removeAttribute(String key)
removeAttribute 在接口中 Streamkey - the attribute keyStream.setAttribute(String, Object)public boolean isClosed()
public boolean isRemotelyClosed()
public boolean isLocallyClosed()
public boolean isOpen()
isOpen 在类中 IdleTimeoutprotected void onIdleExpired(TimeoutException timeout)
onIdleExpired 在类中 IdleTimeoutpublic Stream.Listener getListener()
getListener 在接口中 StreamSPIpublic void setListener(Stream.Listener listener)
setListener 在接口中 StreamSPIlistener - the associated with this streampublic void process(Frame frame, Callback callback)
StreamSPI
Processes the given frame, belonging to this stream.
public boolean updateClose(boolean update,
boolean local)
StreamSPIUpdates the close state of this stream.
updateClose 在接口中 StreamSPIupdate - whether to update the close statelocal - whether the update comes from a local operation (such as
sending a frame that ends the stream) or a remote operation
(such as receiving a framepublic int getSendWindow()
public int getRecvWindow()
public int updateSendWindow(int delta)
StreamSPI
Updates the stream send window by the given delta.
updateSendWindow 在接口中 StreamSPIdelta - the delta value (positive or negative) to add to the stream
send windowpublic int updateRecvWindow(int delta)
StreamSPI
Updates the stream receive window by the given delta.
updateRecvWindow 在接口中 StreamSPIdelta - the delta value (positive or negative) to add to the stream
receive windowpublic void close()
StreamSPIForcibly closes this stream.
Copyright © 2016. All rights reserved.