Package io.grpc.servlet
Class ServletServerBuilder.ServerTransportImpl
java.lang.Object
io.grpc.servlet.ServletServerBuilder.ServerTransportImpl
- All Implemented Interfaces:
ServerTransport,InternalInstrumented<InternalChannelz.SocketStats>,InternalWithLogId
- Enclosing class:
ServletServerBuilder
static final class ServletServerBuilder.ServerTransportImpl
extends Object
implements ServerTransport
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InternalLogIdprivate final ScheduledExecutorService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLogId()Returns an ID that is primarily used in debug logs.Returns an executor for scheduling provided by the transport.com.google.common.util.concurrent.ListenableFuture<InternalChannelz.SocketStats> getStats()Returns the stats object.voidshutdown()Initiates an orderly shutdown of the transport.voidshutdownNow(Status reason) Initiates a forceful shutdown in which preexisting and new calls are closed.
-
Field Details
-
logId
-
scheduler
-
-
Constructor Details
-
ServerTransportImpl
ServerTransportImpl(ScheduledExecutorService scheduler)
-
-
Method Details
-
shutdown
public void shutdown()Description copied from interface:ServerTransportInitiates an orderly shutdown of the transport. Existing streams continue, but new streams will eventually begin failing. New streams "eventually" begin failing because shutdown may need to be processed on a separate thread. May only be called once.- Specified by:
shutdownin interfaceServerTransport
-
shutdownNow
Description copied from interface:ServerTransportInitiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the providedreason.- Specified by:
shutdownNowin interfaceServerTransport
-
getScheduledExecutorService
Description copied from interface:ServerTransportReturns an executor for scheduling provided by the transport. The service should be configured to allow cancelled scheduled runnables to be GCed.The executor may not be used after the transport terminates. The caller should ensure any outstanding tasks are cancelled when the transport terminates.
- Specified by:
getScheduledExecutorServicein interfaceServerTransport
-
getStats
Description copied from interface:InternalInstrumentedReturns the stats object.- Specified by:
getStatsin interfaceInternalInstrumented<InternalChannelz.SocketStats>
-
getLogId
Description copied from interface:InternalWithLogIdReturns an ID that is primarily used in debug logs. It usually contains the class name and a numeric ID that is unique among the instances.The subclasses of this interface usually want to include the log ID in their
Object.toString()results.- Specified by:
getLogIdin interfaceInternalWithLogId
-