- All Implemented Interfaces:
Closeable,AutoCloseable,Stream,org.eclipse.jetty.io.CyclicTimeouts.Expirable,org.eclipse.jetty.util.Attachable,org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.thread.Invocable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn ordered list of frames belonging to the same stream.Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream
Stream.Data, Stream.Listener -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.Callback
NOOPFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking -
Constructor Summary
ConstructorsConstructorDescriptionHTTP2Stream(HTTP2Session session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcommit()voidSends the given DATAframe.voiddemand()Demands moreDATAframes for this stream, causingStream.Listener.onDataAvailable(Stream)to be invoked, possibly at a later time, when the stream has data to be read.dump()voiddump(Appendable out, String indent) voidgetAttribute(String key) longintgetId()longorg.eclipse.jetty.util.thread.Invocable.InvocationTypeintintvoidheaders(HeadersFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given HEADERSframe.booleanisClosed()booleanbooleanisLocal()booleanbooleanisOpen()booleanbooleanisReset()booleanvoidnotIdle()voidonClose()protected voidonIdleExpired(TimeoutException timeout) voidprocess(Stream.Data data) voidvoidvoidpush(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Sends the given PUSH_PROMISEframe.readData()Reads DATA frames from this stream, wrapping them in retainableStream.Dataobjects.removeAttribute(String key) voidreset(ResetFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given RST_STREAMframe.voidsend(HTTP2Stream.FrameList frameList, org.eclipse.jetty.util.Callback callback) voidsetAttachment(Object attachment) voidsetAttribute(String key, Object value) voidsetIdleTimeout(long idleTimeout) voidsetListener(Stream.Listener listener) voidtoString()booleanupdateClose(boolean update, CloseState.Event event) intupdateRecvWindow(int delta) intupdateSendWindow(int delta) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Callback
completeWithMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelf
-
Constructor Details
-
HTTP2Stream
public HTTP2Stream(HTTP2Session session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local)
-
-
Method Details
-
getId
public int getId() -
getAttachment
- Specified by:
getAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
setAttachment
- Specified by:
setAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
isLocal
public boolean isLocal() -
getSession
- Specified by:
getSessionin interfaceStream- Returns:
- the session this stream is associated to
-
headers
Description copied from interface:StreamSends the given HEADERS
frame.Typically used to send an HTTP response or to send the HTTP response trailers.
-
send
-
push
public void push(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Description copied from interface:StreamSends the given PUSH_PROMISE
frame. -
data
Description copied from interface:StreamSends the given DATA
frame. -
reset
Description copied from interface:StreamSends the given RST_STREAM
frame. -
getAttribute
- Specified by:
getAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- an arbitrary object associated with the given key to this stream or null if no object can be found for the given key.
- See Also:
-
setAttribute
- Specified by:
setAttributein interfaceStream- Parameters:
key- the attribute keyvalue- an arbitrary object to associate with the given key to this stream- See Also:
-
removeAttribute
- Specified by:
removeAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- the arbitrary object associated with the given key to this stream
- See Also:
-
isReset
public boolean isReset() -
isResetOrFailed
public boolean isResetOrFailed() -
isClosed
public boolean isClosed() -
isRemotelyClosed
public boolean isRemotelyClosed()- Specified by:
isRemotelyClosedin interfaceStream- Returns:
- whether the stream is closed remotely.
- See Also:
-
isLocallyClosed
public boolean isLocallyClosed() -
commit
public void commit() -
isCommitted
public boolean isCommitted() -
isOpen
public boolean isOpen() -
notIdle
public void notIdle() -
getExpireNanoTime
public long getExpireNanoTime()- Specified by:
getExpireNanoTimein interfaceorg.eclipse.jetty.io.CyclicTimeouts.Expirable
-
getIdleTimeout
public long getIdleTimeout()- Specified by:
getIdleTimeoutin interfaceStream- Returns:
- the stream idle timeout
- See Also:
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout) - Specified by:
setIdleTimeoutin interfaceStream- Parameters:
idleTimeout- the stream idle timeout- See Also:
-
onIdleExpired
-
getListener
- Specified by:
getListenerin interfaceStream- Returns:
- the
Stream.Listenerassociated with this stream
-
readData
Description copied from interface:StreamReads DATA frames from this stream, wrapping them in retainable
Stream.Dataobjects.The returned
Stream.Dataobject may benull, indicating that the end of the read side of the stream has not yet been reached, which may happen in these cases:- not all the bytes have been received so far, for example the remote peer did not send them yet, or they are in-flight
- all the bytes have been received, but there is a trailer HEADERS frame to be received to indicate the end of the read side of the stream
When the returned
Stream.Dataobject is notnull, applications must call, either immediately or later (possibly asynchronously)Stream.Data.release()to notify the implementation that the bytes have been processed.Stream.Dataobjects may be stored away for later, asynchronous, processing (for example, to process them only when all of them have been received).- Specified by:
readDatain interfaceStream- Returns:
- a
Stream.Dataobject containing the DATA frame, or null if no DATA frame is available - See Also:
-
setListener
-
process
-
process
-
demand
public void demand()Description copied from interface:StreamDemands more
DATAframes for this stream, causingStream.Listener.onDataAvailable(Stream)to be invoked, possibly at a later time, when the stream has data to be read.This method is idempotent: calling it when there already is an outstanding demand to invoke
Stream.Listener.onDataAvailable(Stream)is a no-operation.The thread invoking this method may invoke directly
Stream.Listener.onDataAvailable(Stream), unless another thread that must invokeStream.Listener.onDataAvailable(Stream)notices the outstanding demand first.When all bytes have been read (via
Stream.readData()), further invocations of this method are a no-operation.It is always guaranteed that invoking this method from within
onDataAvailable(Stream)will not cause aStackOverflowError. -
processData
public void processData() -
updateClose
-
getSendWindow
public int getSendWindow() -
getRecvWindow
public int getRecvWindow() -
updateSendWindow
public int updateSendWindow(int delta) -
updateRecvWindow
public int updateRecvWindow(int delta) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
onClose
public void onClose() -
succeeded
public void succeeded()- Specified by:
succeededin interfaceorg.eclipse.jetty.util.Callback
-
failed
- Specified by:
failedin interfaceorg.eclipse.jetty.util.Callback
-
getInvocationType
public org.eclipse.jetty.util.thread.Invocable.InvocationType getInvocationType()- Specified by:
getInvocationTypein interfaceorg.eclipse.jetty.util.thread.Invocable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-
toString
-