Top Description Inners Fields Constructors Methods
reactor.netty

public final Class ReactorNetty

extends Object
Class Inheritance
Imports
java.net.SocketAddress, java.nio.channels.FileChannel, java.nio.file.Path, java.time.ZoneId, java.util.List, .Objects, java.util.concurrent.Callable, .TimeUnit, java.util.concurrent.atomic.AtomicLong, java.util.function.BiConsumer, .BiFunction, .Consumer, .Function, .Predicate, io.netty.buffer.ByteBuf, .ByteBufAllocator, .ByteBufHolder, .ByteBufUtil, .Unpooled, io.netty.channel.Channel, .ChannelHandler, .ChannelHandlerContext, .ChannelInboundHandlerAdapter, .ChannelPipeline, io.netty.channel.nio.NioEventLoop, io.netty.handler.ssl.SslHandler, io.netty.handler.stream.ChunkedWriteHandler, io.netty.handler.timeout.IdleState, .IdleStateEvent, .IdleStateHandler, io.netty.util.AttributeKey, .ReferenceCounted, org.reactivestreams.Publisher, .Subscription, reactor.core.CorePublisher, reactor.core.publisher.BaseSubscriber, .Flux, .Mono, .SignalType, reactor.pool.AllocationStrategy, .PoolBuilder, reactor.pool.introspection.SamplingAllocationStrategy, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, reactor.util.context.Context, .ContextView

Internal helpers for reactor-netty contracts.
Author
Stephane Maldini

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
ReactorNetty.ExtractorHandler

A handler that can be used to extract ByteBuf out of ByteBufHolder, optionally also outputting additional messages.

pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
ReactorNetty.OutboundThen

An appending write that delegates to its origin context and append the passed publisher after the origin success if any.

pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final String
ACCESS_LOG_ENABLED

Specifies whether the Http Server access log will be enabled.

pack-priv static final ConnectionObserver.State
pack-priv static final ByteBuf
pack-priv static final char
pack-priv static final String
pack-priv static final char
pack-priv static final ConnectionObserver.State
pack-priv static final ConnectionObserver.State
pack-priv static final AttributeKey<Connection>
pack-priv static final AttributeKey<ContextView>
pack-priv static final ConnectionObserver.State
pack-priv static final Consumer<? super FileChannel>
public static final String
IO_SELECT_COUNT

Default selector thread count, fallback to -1 (no selector thread)

Note

In most use cases using a worker thread also as a selector thread works well.

public static final String
IO_WORKER_COUNT

Default worker thread count, fallback to available processor (but with a minimum value of 4).

pack-priv static final Logger
pack-priv static final boolean
LOG_CHANNEL_INFO

Specifies whether the channel ID will be prepended to the log message when possible.

public static final String
NATIVE

Default value whether the native transport (epoll, kqueue) will be preferred, fallback it will be preferred when available.

pack-priv static final ChannelPipelineConfigurer
pack-priv static final ConnectionObserver
pack-priv static final String
pack-priv static final int
pack-priv static final AttributeKey<Boolean>
public static final String
POOL_ACQUIRE_TIMEOUT

Default acquisition timeout (milliseconds) before error.

public static final String
POOL_GET_PERMITS_SAMPLING_RATE

Default getPermitsSamplingRate (between 0d and 1d (percentage)) to be used with a SamplingAllocationStrategy.

public static final String
POOL_LEASING_STRATEGY

Default leasing strategy (fifo, lifo), fallback to fifo.

public static final String
POOL_MAX_CONNECTIONS

Default max connections.

public static final String
POOL_MAX_IDLE_TIME

Default max idle time, fallback - max idle time is not specified.

public static final String
POOL_MAX_LIFE_TIME

Default max life time, fallback - max life time is not specified.

public static final String
POOL_RETURN_PERMITS_SAMPLING_RATE

Default returnPermitsSamplingRate (between 0d and 1d (percentage)) to be used with a SamplingAllocationStrategy.

pack-priv static final Predicate<ByteBuf>
pack-priv static final Predicate<Object>
public static final Predicate<ByteBuf>
pack-priv static final ConnectionObserver.State
public static final String
SHUTDOWN_QUIET_PERIOD

Default quiet period that guarantees that the disposal of the underlying LoopResources will not happen, fallback to 2 seconds.

public static final String
SHUTDOWN_TIMEOUT

Default maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period, fallback to 15 seconds.

public static final String
SSL_CLIENT_DEBUG

Default value whether the SSL debugging on the client side will be enabled/disabled, fallback to SSL debugging disabled.

public static final String
SSL_HANDSHAKE_TIMEOUT

Default SSL handshake timeout (milliseconds), fallback to 10 seconds.

public static final String
SSL_SERVER_DEBUG

Default value whether the SSL debugging on the server side will be enabled/disabled, fallback to SSL debugging disabled.

pack-priv static final char
public static final String
UDP_IO_THREAD_COUNT

Default worker thread count for UDP, fallback to available processor (but with a minimum value of 4).

public static final ZoneId
ZONE_ID_SYSTEM

Specifies the zone id used by the access log.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
pack-priv static void
addHandlerAfterReactorCodecs(Connection
the Connection on which to add the decoder.
context
,
String
the name of the encoder.
name
,
ChannelHandler
the encoder to add after the initial reactor-specific handlers.
handler
)

A common implementation for the Connection#addHandlerFirst(String, ChannelHandler) method that can be reused by other implementors.

pack-priv static void
addHandlerBeforeReactorEndHandlers(Connection
the Connection on which to add the decoder.
context
,
String
the name of the decoder.
name
,
ChannelHandler
the decoder to add before the final reactor-specific handlers.
handler
)

A common implementation for the Connection#addHandlerLast(String, ChannelHandler) method that can be reused by other implementors.

pack-priv static ConnectionObserver
public static String

Returns:

a formatted msg
format
(Channel
current channel associated with the msg
channel
,
String
the log msg
msg
)

Append channel ID to a log message for correlated traces.

public static ContextView

Returns:

ContextView from the channel attributes when exists otherwise returns null
getChannelContext
(Channel
the channel
channel
)

Returns ContextView from the channel attributes when exists otherwise returns null.

pack-priv static boolean
pack-priv static <T, V> CorePublisher<V>
publisherOrScalarMap(Publisher<T> publisher, Function<? super T, ? extends V> mapper)

pack-priv static <T, V> CorePublisher<V>
publisherOrScalarMap(Publisher<T> publisher, Function<? super T, ? extends V> monoMapper, Function<? super List<T>, ? extends V> fluxMapper)

pack-priv static void
registerForClose(boolean shouldCleanupOnClose, String name, Connection context)

pack-priv static void
removeHandler(Channel channel, String name)

pack-priv static void
replaceHandler(Channel channel, String name, ChannelHandler handler)

public static void
safeRelease(Object msg)

Try to call ReferenceCounted#release() if the specified message implements ReferenceCounted.

public static void
setChannelContext(Channel
the channel
channel
,
ContextView
ContextView that will be added to the channel attributes
contextView
)

Adds ContextView to the channel attributes.

public static String
toPrettyHexDump(Object msg)

Deprecated as of 1.1.0. This will be removed in 2.0.0 as the functionality is not used anymore.
Pretty hex dump will be returned when the object is ByteBuf or ByteBufHolder.
pack-priv static NettyInbound
pack-priv static NettyOutbound
public static RuntimeException

Returns:

a wrapped RuntimeException
wrapException
(Throwable throwable)

Wrap possibly fatal or singleton exception into a new exception instance in order to propagate in reactor flows without side effect.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait