Package io.grpc.netty
Class NettyServerStream
- java.lang.Object
-
- io.grpc.internal.AbstractStream
-
- io.grpc.internal.AbstractServerStream
-
- io.grpc.netty.NettyServerStream
-
- All Implemented Interfaces:
MessageFramer.Sink,ServerStream,Stream
class NettyServerStream extends AbstractServerStream
Server stream for a Netty HTTP2 transport. Must only be called from the sending application thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classNettyServerStream.Sinkstatic classNettyServerStream.TransportStateThis should only be called from the transport thread.
-
Field Summary
Fields Modifier and Type Field Description private Attributesattributesprivate java.lang.Stringauthorityprivate static java.util.logging.Loggerlogprivate NettyServerStream.Sinksinkprivate NettyServerStream.TransportStatestateprivate intstreamIdprivate WriteQueuewriteQueue
-
Constructor Summary
Constructors Constructor Description NettyServerStream(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, java.lang.String authority, StatsTraceContext statsTraceCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NettyServerStream.SinkabstractServerStreamSink()Sink for transport to be called to perform outbound operations.AttributesgetAttributes()Attributes describing stream.java.lang.StringgetAuthority()Gets the authority this stream is addressed to.intstreamId()The HTTP/2 stream id, or-1if not supported.protected NettyServerStream.TransportStatetransportState()Obtain the transport state corresponding to this stream.-
Methods inherited from class io.grpc.internal.AbstractServerStream
cancel, close, deliverFrame, framer, isReady, setDecompressor, setListener, setOnReadyThreshold, statsTraceContext, writeHeaders
-
Methods inherited from class io.grpc.internal.AbstractStream
endOfMessages, flush, onSendingBytes, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.grpc.internal.Stream
flush, optimizeForDirectExecutor, request, setCompressor, setMessageCompression, writeMessage
-
-
-
-
Field Detail
-
log
private static final java.util.logging.Logger log
-
sink
private final NettyServerStream.Sink sink
-
state
private final NettyServerStream.TransportState state
-
writeQueue
private final WriteQueue writeQueue
-
attributes
private final Attributes attributes
-
authority
private final java.lang.String authority
-
streamId
private final int streamId
-
-
Constructor Detail
-
NettyServerStream
public NettyServerStream(io.netty.channel.Channel channel, NettyServerStream.TransportState state, Attributes transportAttrs, java.lang.String authority, StatsTraceContext statsTraceCtx)
-
-
Method Detail
-
transportState
protected NettyServerStream.TransportState transportState()
Description copied from class:AbstractStreamObtain the transport state corresponding to this stream. Each stream must have its own unique transport state.- Specified by:
transportStatein classAbstractServerStream
-
abstractServerStreamSink
protected NettyServerStream.Sink abstractServerStreamSink()
Description copied from class:AbstractServerStreamSink for transport to be called to perform outbound operations. Each stream must have its own unique sink.- Specified by:
abstractServerStreamSinkin classAbstractServerStream
-
getAttributes
public Attributes getAttributes()
Description copied from interface:ServerStreamAttributes describing stream. This is inherited from the transport attributes, and used as the basis ofServerCall.getAttributes().- Specified by:
getAttributesin interfaceServerStream- Overrides:
getAttributesin classAbstractServerStream- Returns:
- Attributes container
-
getAuthority
public java.lang.String getAuthority()
Description copied from interface:ServerStreamGets the authority this stream is addressed to.- Specified by:
getAuthorityin interfaceServerStream- Overrides:
getAuthorityin classAbstractServerStream- Returns:
- the authority string.
nullif not available.
-
streamId
public int streamId()
Description copied from interface:ServerStreamThe HTTP/2 stream id, or-1if not supported.
-
-