Top Description Inners Fields Constructors Methods
reactor.netty.transport

public abstract Class ServerTransport<T extends reactor.netty.transport.ServerTransport<T, CONF>, CONF extends reactor.netty.transport.ServerTransportConfig<CONF>>

extends Transport<T extends ServerTransport<T, CONF>, CONF extends ServerTransportConfig<CONF>>
Class Inheritance
Known Direct Subclasses
reactor.netty.tcp.TcpServer
Type Parameters
<T>
ServerTransport implementation
<CONF>
Server Configuration implementation
Imports
java.io.IOException, java.net.InetSocketAddress, .SocketAddress, java.time.Duration, java.util.ArrayList, .HashMap, .List, .Map, .Objects, java.util.concurrent.TimeUnit, java.util.function.Consumer, io.netty.bootstrap.ServerBootstrap, io.netty.channel.Channel, .ChannelConfig, .ChannelFutureListener, .ChannelHandler, .ChannelHandlerContext, .ChannelInboundHandlerAdapter, .ChannelInitializer, .ChannelOption, .EventLoopGroup, .ServerChannel, io.netty.channel.unix.DomainSocketAddress, io.netty.handler.codec.DecoderException, io.netty.util.AttributeKey, org.reactivestreams.Subscription, reactor.core.CoreSubscriber, reactor.core.publisher.Mono, .MonoSink, .Operators, reactor.netty.ChannelBindException, .Connection, .ConnectionObserver, .DisposableServer, .FutureMono, reactor.netty.channel.AbortedException, .ChannelOperations, reactor.netty.internal.util.MapUtils, reactor.netty.resources.ConnectionProvider, .LoopResources, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context

A generic server Transport that will bind() to a local address and provide a DisposableServer.
Authors
Stephane Maldini, Violeta Georgieva
Since
1.0.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Mono<? extends DisposableServer>

Returns:

a Mono of DisposableServer
bind
()

Binds the ServerTransport and returns a Mono of DisposableServer.

public final DisposableServer

Returns:

a Mono of Connection
bindNow
()

Starts the server in a blocking fashion, and waits for it to finish initializing or the startup timeout expires (the startup timeout is 45 seconds).

public final DisposableServer

Returns:

a DisposableServer
bindNow
(Duration
max startup timeout (resolution: ns)
timeout
)

Start the server in a blocking fashion, and wait for it to finish initializing or the provided startup timeout expires.

public final void
bindUntilJavaShutdown(Duration
a timeout for server shutdown
timeout
,
Consumer<DisposableServer>
an optional callback on server start
onStart
)

Start the server in a fully blocking fashion, not only waiting for it to initialize but also blocking during the full lifecycle of the server.

public <
the attribute type
A
>
T

Returns:

a new ServerTransport reference
childAttr
(AttributeKey<A>
the attribute key
key
,
A
the attribute value - null to remove a key
value
)

Injects default attribute to the future child Channel connections.

public T

Returns:

a new ServerTransport reference
childObserve
(ConnectionObserver
the ConnectionObserver addition
observer
)

Set or add the given ConnectionObserver for each remote connection.

public <
the option type
A
>
T

Returns:

a new ServerTransport reference
childOption
(ChannelOption<A>
the option key
key
,
A
the option value - null to remove a key
value
)

Injects default options to the future child Channel connections.

public T

Returns:

a new ServerTransport reference
doOnBind
(Consumer<? super CONF>
a consumer observing connected events
doOnBind
)

Set or add a callback called when ServerTransport is about to start listening for incoming traffic.

public T

Returns:

a new ServerTransport reference
doOnBound
(Consumer<? super DisposableServer>
a consumer observing connected events
doOnBound
)

Set or add a callback called after DisposableServer has been started.

public T

Returns:

a new ServerTransport reference
doOnConnection
(Consumer<? super Connection>
a consumer observing remote connections
doOnConnection
)

Set or add a callback called on new remote Connection.

public T

Returns:

a new ServerTransport reference
doOnUnbound
(Consumer<? super DisposableServer>
a consumer observing unbound events
doOnUnbound
)

Set or add a callback called after DisposableServer has been shutdown.

public T

Returns:

a new ServerTransport reference
host
(String
the host to bind to.
host
)

The host to which this server should bind.

public T

Returns:

a new ServerTransport reference
port
(int
The port to bind to.
port
)

The port to which this server should bind.

public Mono<Void>

Returns:

a Mono representing the completion of the warmup
warmup
()

Based on the actual configuration, returns a Mono that triggers:

  • an initialization of the event loop groups
  • loads the necessary native libraries for the transport
Inherited from reactor.netty.transport.Transport:
attrbindAddresschannelGroupconfigurationdoOnChannelInitduplicatemetricsmetricsobserveoptionrunOnrunOnrunOnwiretapwiretapwiretapwiretapwiretap