Package io.grpc.servlet.jakarta
Class ServletServerBuilder.InternalServerImpl
- java.lang.Object
-
- io.grpc.servlet.jakarta.ServletServerBuilder.InternalServerImpl
-
- All Implemented Interfaces:
InternalServer
- Enclosing class:
- ServletServerBuilder
private static final class ServletServerBuilder.InternalServerImpl extends java.lang.Object implements InternalServer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ServerListener
serverListener
-
Constructor Summary
Constructors Constructor Description InternalServerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.SocketAddress
getListenSocketAddress()
Returns the first listening socket address.java.util.List<? extends java.net.SocketAddress>
getListenSocketAddresses()
Returns a list of listening socket addresses.InternalInstrumented<InternalChannelz.SocketStats>
getListenSocketStats()
Returns the first listen socket stats of this server.java.util.List<InternalInstrumented<InternalChannelz.SocketStats>>
getListenSocketStatsList()
Returns a list of listen socket stats of this server.void
shutdown()
Initiates an orderly shutdown of the server.void
start(ServerListener listener)
Starts transport.
-
-
-
Field Detail
-
serverListener
ServerListener serverListener
-
-
Method Detail
-
start
public void start(ServerListener listener)
Description copied from interface:InternalServer
Starts transport. Implementations must not calllistener
until afterstart()
returns. The method only returns after it has done the equivalent of bind()ing, so it will be able to service any connections created after returning.- Specified by:
start
in interfaceInternalServer
- Parameters:
listener
- non-null
listener of server events
-
shutdown
public void shutdown()
Description copied from interface:InternalServer
Initiates an orderly shutdown of the server. Existing transports continue, but new transports will not be created (onceServerListener.serverShutdown()
callback is called). This method may only be called once. Blocks until the listening socket(s) have been closed. If interrupted, this method will not wait for the close to complete, but it will happen asynchronously.- Specified by:
shutdown
in interfaceInternalServer
-
getListenSocketAddress
public java.net.SocketAddress getListenSocketAddress()
Description copied from interface:InternalServer
Returns the first listening socket address. May change afterInternalServer.start(ServerListener)
is called.- Specified by:
getListenSocketAddress
in interfaceInternalServer
-
getListenSocketStats
public InternalInstrumented<InternalChannelz.SocketStats> getListenSocketStats()
Description copied from interface:InternalServer
Returns the first listen socket stats of this server. May returnnull
.- Specified by:
getListenSocketStats
in interfaceInternalServer
-
getListenSocketAddresses
public java.util.List<? extends java.net.SocketAddress> getListenSocketAddresses()
Description copied from interface:InternalServer
Returns a list of listening socket addresses. May change afterInternalServer.start(ServerListener)
is called.- Specified by:
getListenSocketAddresses
in interfaceInternalServer
-
getListenSocketStatsList
@Nullable public java.util.List<InternalInstrumented<InternalChannelz.SocketStats>> getListenSocketStatsList()
Description copied from interface:InternalServer
Returns a list of listen socket stats of this server. May returnnull
.- Specified by:
getListenSocketStatsList
in interfaceInternalServer
-
-