public class UdpResources extends java.lang.Object implements LoopResources
DEFAULT_IO_SELECT_COUNT, DEFAULT_IO_WORKER_COUNT| Modifier | Constructor and Description |
|---|---|
protected |
UdpResources(LoopResources defaultLoops) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_dispose()
Dispose underlying resources
|
protected reactor.core.publisher.Mono<java.lang.Void> |
_disposeLater()
Dispose underlying resources in a listenable fashion.
|
boolean |
daemon()
return true if
EventLoopGroup should not be shutdown |
void |
dispose() |
reactor.core.publisher.Mono<java.lang.Void> |
disposeLater()
Returns a Mono that triggers the disposal of underlying resources when subscribed to.
|
static UdpResources |
get()
Return the global UDP resources for pooling
|
protected static UdpResources |
getOrCreate(LoopResources loops,
java.util.function.Function<LoopResources,UdpResources> onNew,
java.lang.String name)
Safely check if existing resource exist and proceed to update/cleanup if new
resources references are passed.
|
boolean |
isDisposed() |
java.lang.Class<? extends io.netty.channel.Channel> |
onChannel(io.netty.channel.EventLoopGroup group)
Callback for client or generic channel factory selection.
|
io.netty.channel.EventLoopGroup |
onClient(boolean useNative)
Callback for client
EventLoopGroup creation. |
java.lang.Class<? extends io.netty.channel.socket.DatagramChannel> |
onDatagramChannel(io.netty.channel.EventLoopGroup group)
Callback for UDP channel factory selection.
|
io.netty.channel.EventLoopGroup |
onServer(boolean useNative)
Callback for server
EventLoopGroup creation. |
java.lang.Class<? extends io.netty.channel.ServerChannel> |
onServerChannel(io.netty.channel.EventLoopGroup group)
Callback for server channel factory selection.
|
io.netty.channel.EventLoopGroup |
onServerSelect(boolean useNative)
Create a server select
EventLoopGroup for servers to be used |
boolean |
preferNative()
Return true if should default to native
EventLoopGroup and Channel |
static UdpResources |
reset()
Reset UDP resources to default and return its instance
|
static UdpResources |
set(LoopResources loops)
Update pooling resources and return the global UDP resources
|
static void |
shutdown()
Shutdown the global
UdpResources without resetting them,
effectively cleaning up associated resources without creating new ones. |
static reactor.core.publisher.Mono<java.lang.Void> |
shutdownLater()
Prepare to shutdown the global
UdpResources without resetting them,
effectively cleaning up associated resources without creating new ones. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcolocate, create, create, createprotected UdpResources(LoopResources defaultLoops)
public static UdpResources get()
public static UdpResources set(LoopResources loops)
loops - the eventual new LoopResourcespublic static UdpResources reset()
public static void shutdown()
UdpResources without resetting them,
effectively cleaning up associated resources without creating new ones.public static reactor.core.publisher.Mono<java.lang.Void> shutdownLater()
UdpResources without resetting them,
effectively cleaning up associated resources without creating new ones. This only
occurs when the returned Mono is subscribed to.Mono triggering the shutdown() when subscribed to.public void dispose()
dispose in interface reactor.core.Disposabledispose in interface LoopResourcespublic reactor.core.publisher.Mono<java.lang.Void> disposeLater()
LoopResourcesdisposeLater in interface LoopResourcesprotected void _dispose()
protected reactor.core.publisher.Mono<java.lang.Void> _disposeLater()
public boolean isDisposed()
isDisposed in interface reactor.core.Disposablepublic java.lang.Class<? extends io.netty.channel.Channel> onChannel(io.netty.channel.EventLoopGroup group)
LoopResourcesonChannel in interface LoopResourcesgroup - the source EventLoopGroup to assign a loop fromClass target for the underlying Channel factorypublic io.netty.channel.EventLoopGroup onClient(boolean useNative)
LoopResourcesEventLoopGroup creation.onClient in interface LoopResourcesuseNative - should use native group if current LoopResources.preferNative() is also
trueEventLoopGrouppublic java.lang.Class<? extends io.netty.channel.socket.DatagramChannel> onDatagramChannel(io.netty.channel.EventLoopGroup group)
LoopResourcesonDatagramChannel in interface LoopResourcesgroup - the source EventLoopGroup to assign a loop fromClass target for the underlying Channel factorypublic io.netty.channel.EventLoopGroup onServer(boolean useNative)
LoopResourcesEventLoopGroup creation.onServer in interface LoopResourcesuseNative - should use native group if current LoopResources.preferNative() is also
trueEventLoopGrouppublic java.lang.Class<? extends io.netty.channel.ServerChannel> onServerChannel(io.netty.channel.EventLoopGroup group)
LoopResourcesonServerChannel in interface LoopResourcesgroup - the source EventLoopGroup to assign a loop fromClass target for the underlying ServerChannel factorypublic io.netty.channel.EventLoopGroup onServerSelect(boolean useNative)
LoopResourcesEventLoopGroup for servers to be usedonServerSelect in interface LoopResourcesuseNative - should use native group if current LoopResources.preferNative() is also
trueEventLoopGrouppublic boolean preferNative()
LoopResourcesEventLoopGroup and ChannelpreferNative in interface LoopResourcesEventLoopGroup and Channelpublic boolean daemon()
LoopResourcesEventLoopGroup should not be shutdowndaemon in interface LoopResourcesEventLoopGroup should not be shutdownprotected static UdpResources getOrCreate(LoopResources loops, java.util.function.Function<LoopResources,UdpResources> onNew, java.lang.String name)
loops - the eventual new LoopResourcesonNew - a UdpResources factoryname - a name for resourcesUdpResources