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 java.lang.Object implements ServerTransport
-
-
Field Summary
Fields Modifier and Type Field Description private InternalLogId
logId
private java.util.concurrent.ScheduledExecutorService
scheduler
-
Constructor Summary
Constructors Constructor Description ServerTransportImpl(java.util.concurrent.ScheduledExecutorService scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InternalLogId
getLogId()
Returns an ID that is primarily used in debug logs.java.util.concurrent.ScheduledExecutorService
getScheduledExecutorService()
Returns an executor for scheduling provided by the transport.com.google.common.util.concurrent.ListenableFuture<InternalChannelz.SocketStats>
getStats()
Returns the stats object.void
shutdown()
Initiates an orderly shutdown of the transport.void
shutdownNow(Status reason)
Initiates a forceful shutdown in which preexisting and new calls are closed.
-
-
-
Field Detail
-
logId
private final InternalLogId logId
-
scheduler
private final java.util.concurrent.ScheduledExecutorService scheduler
-
-
Method Detail
-
shutdown
public void shutdown()
Description copied from interface:ServerTransport
Initiates 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:
shutdown
in interfaceServerTransport
-
shutdownNow
public void shutdownNow(Status reason)
Description copied from interface:ServerTransport
Initiates a forceful shutdown in which preexisting and new calls are closed. Existing calls should be closed with the providedreason
.- Specified by:
shutdownNow
in interfaceServerTransport
-
getScheduledExecutorService
public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
Description copied from interface:ServerTransport
Returns 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:
getScheduledExecutorService
in interfaceServerTransport
-
getStats
public com.google.common.util.concurrent.ListenableFuture<InternalChannelz.SocketStats> getStats()
Description copied from interface:InternalInstrumented
Returns the stats object.- Specified by:
getStats
in interfaceInternalInstrumented<InternalChannelz.SocketStats>
-
getLogId
public InternalLogId getLogId()
Description copied from interface:InternalWithLogId
Returns 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:
getLogId
in interfaceInternalWithLogId
-
-