public class SpdyStream extends Object implements AttributeStorage, OutputSink, Closeable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SpdyStream.Termination |
protected static class |
SpdyStream.TerminationType |
| Modifier and Type | Field and Description |
|---|---|
static String |
SPDY_STREAM_ATTRIBUTE |
| Modifier | Constructor and Description |
|---|---|
protected |
SpdyStream(SpdySession spdySession,
HttpRequestPacket spdyRequest,
int streamId,
int associatedToStreamId,
int priority,
int slot,
boolean isUnidirectional) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(CloseListener closeListener)
Add the
CloseListener, which will be notified once the stream
will be closed. |
PushResource |
addPushResource(String url,
PushResource pushResource) |
void |
assertOpen()
Checks if this Closeable is open and ready to be used.
|
boolean |
canWrite() |
boolean |
canWrite(int length)
Deprecated.
|
GrizzlyFuture<Closeable> |
close()
Gracefully (if supported by the implementation) closes this stream and
releases any system resources associated with it.
|
void |
close(CompletionHandler<Closeable> completionHandler)
Deprecated.
please use
close() with the following GrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler) call |
GrizzlyFuture<CloseReason> |
closeFuture() |
void |
closeSilently()
Gracefully (if supported by the implementation) closes this stream and
releases any system resources associated with it.
|
void |
closeWithReason(IOException cause)
Gracefully closes the Closeable and provides the reason description.
|
int |
getAssociatedToStreamId() |
AttributeHolder |
getAttributes()
Get associated
AttributeHolder. |
int |
getLocalWindowSize() |
int |
getPeerWindowSize() |
int |
getPriority() |
int |
getSlot() |
HttpRequestPacket |
getSpdyRequest() |
HttpResponsePacket |
getSpdyResponse() |
static SpdyStream |
getSpdyStream(HttpHeader httpHeader) |
int |
getStreamId() |
int |
getUnflushedWritesCount() |
boolean |
isLocallyInitiatedStream() |
boolean |
isOpen()
Is Closeable open and ready.
|
boolean |
isUnidirectional() |
void |
notifyCanWrite(WriteHandler writeHandler)
Instructs the
OutputSink to invoke the provided
WriteHandler when it is possible to write more bytes (or characters). |
void |
notifyCanWrite(WriteHandler handler,
int length)
Deprecated.
|
boolean |
removeCloseListener(CloseListener closeListener)
Remove the
CloseListener. |
PushResource |
removePushResource(String url) |
GrizzlyFuture<Closeable> |
terminate()
Closes this stream and releases any system resources associated with it.
|
void |
terminateSilently()
Closes this stream and releases any system resources associated with it.
|
void |
terminateWithReason(IOException cause)
Closes the Closeable and provides the reason description.
|
public static final String SPDY_STREAM_ATTRIBUTE
protected SpdyStream(SpdySession spdySession, HttpRequestPacket spdyRequest, int streamId, int associatedToStreamId, int priority, int slot, boolean isUnidirectional)
public static SpdyStream getSpdyStream(HttpHeader httpHeader)
public int getPeerWindowSize()
public int getLocalWindowSize()
public int getUnflushedWritesCount()
public HttpRequestPacket getSpdyRequest()
public HttpResponsePacket getSpdyResponse()
public PushResource addPushResource(String url, PushResource pushResource)
public PushResource removePushResource(String url)
public int getStreamId()
public int getAssociatedToStreamId()
public int getPriority()
public int getSlot()
public boolean isUnidirectional()
public boolean isLocallyInitiatedStream()
public boolean isOpen()
Closeablepublic void assertOpen()
throws IOException
CloseableIOException giving the reason why this Closeable
was closed.assertOpen in interface CloseableIOExceptionpublic AttributeHolder getAttributes()
AttributeStorageAttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.getAttributes in interface AttributeStorageAttributeHolder.
Implementation may return null if AttributeHolder wasn't
initialized yet.@Deprecated public boolean canWrite(int length)
canWrite in interface OutputSinklength - specifies the number of bytes (or characters) that require writingtrue if a write to this OutputSink
will succeed, otherwise returns false.public boolean canWrite()
canWrite in interface OutputSinktrue if a write to this OutputSink
will succeed, otherwise returns false.@Deprecated public void notifyCanWrite(WriteHandler handler, int length)
OutputSinkOutputSink to invoke the provided
WriteHandler when it is possible to write length
bytes (or characters).
Note that once the WriteHandler has been notified, it will not
be considered for notification again at a later point in time.notifyCanWrite in interface OutputSinkhandler - the WriteHandler that should be notified
when it's possible to write length bytes.length - the number of bytes or characters that require writing.public void notifyCanWrite(WriteHandler writeHandler)
OutputSinkOutputSink to invoke the provided
WriteHandler when it is possible to write more bytes (or characters).
Note that once the WriteHandler has been notified, it will not
be considered for notification again at a later point in time.notifyCanWrite in interface OutputSinkwriteHandler - the WriteHandler that should be notified
when it's possible to write more data.public GrizzlyFuture<Closeable> terminate()
Closeablepublic void terminateSilently()
CloseableterminateSilently in interface Closeablepublic void terminateWithReason(IOException cause)
CloseableCloseable.terminateSilently(), but additionally
provides the reason why the Closeable will be closed.terminateWithReason in interface Closeablepublic GrizzlyFuture<Closeable> close()
Closeablepublic void closeSilently()
CloseablecloseSilently in interface Closeablepublic void close(CompletionHandler<Closeable> completionHandler)
close() with the following GrizzlyFuture.addCompletionHandler(org.glassfish.grizzly.CompletionHandler) callclose in interface CloseablecompletionHandler - CompletionHandler to be called, when
the stream is closedpublic void closeWithReason(IOException cause)
CloseableCloseable.closeSilently(), but additionally
provides the reason why the Closeable will be closed.closeWithReason in interface Closeablepublic void addCloseListener(CloseListener closeListener)
CloseableCloseListener, which will be notified once the stream
will be closed.addCloseListener in interface CloseablecloseListener - CloseListener.public boolean removeCloseListener(CloseListener closeListener)
CloseableCloseListener.removeCloseListener in interface CloseablecloseListener - CloseListener.public GrizzlyFuture<CloseReason> closeFuture()
closeFuture in interface CloseableFuture, that will be notified once this Closeable
is closedCopyright © 2024 Oracle Corporation. All rights reserved.