public abstract class AbstractNettyChannelFactory extends Object implements NettyChannelFactory
Channel
factories utilitizing netty's Bootstrap
Modifier | Constructor and Description |
---|---|
protected |
AbstractNettyChannelFactory(TransportType type,
Options options,
NettyPropertyResolver resolver)
Constructor for AbstractNettyChannelFactory.
|
protected |
AbstractNettyChannelFactory(TransportType type,
Options options,
NettyPropertyResolver resolver,
NettyChannelInitializer initializer)
Constructor for AbstractNettyChannelFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
configureBootstrap(io.netty.bootstrap.Bootstrap bootstrap)
configureBootstrap.
|
CompletableFuture<io.netty.channel.Channel> |
create(Object data)
create.
|
CompletableFuture<io.netty.channel.Channel> |
create(Object data,
io.netty.channel.EventLoop eventLoop)
create.
|
protected io.netty.channel.RecvByteBufAllocator |
createRecvByteBufAllocator()
createRecvByteBufAllocator.
|
io.netty.bootstrap.Bootstrap |
getBootstrap()
getBootstrap.
|
NettyChannelInitializer |
getChannelInitializer()
getChannelInitializer.
|
io.netty.channel.EventLoopGroup |
getExecutor()
getExecutor.
|
Options |
getOptions()
getOptions.
|
NettyPropertyResolver |
getResolver()
getResolver.
|
TransportType |
getTransportType()
getTransportType.
|
protected io.netty.channel.EventLoopGroup |
initializeEventLoopGroup(@NotNull Class<? extends io.netty.channel.Channel> channelClass,
@NotNull ExecutorService executorService)
Initialize
EventLoopGroup . |
protected abstract CompletableFuture<io.netty.channel.Channel> |
newChannel(Object data)
newChannel.
|
void |
setChannelInitializer(NettyChannelInitializer channelInitializer)
setChannelInitializer.
|
void |
setResolver(NettyPropertyResolver resolver)
setResolver.
|
protected AbstractNettyChannelFactory(TransportType type, Options options, NettyPropertyResolver resolver)
Constructor for AbstractNettyChannelFactory.
type
- a TransportType
objectoptions
- a Options
objectresolver
- a NettyPropertyResolver
objectprotected AbstractNettyChannelFactory(TransportType type, Options options, NettyPropertyResolver resolver, NettyChannelInitializer initializer)
Constructor for AbstractNettyChannelFactory.
type
- a TransportType
objectoptions
- a Options
objectresolver
- a NettyPropertyResolver
objectinitializer
- a NettyChannelInitializer
objectprotected io.netty.channel.EventLoopGroup initializeEventLoopGroup(@NotNull @NotNull Class<? extends io.netty.channel.Channel> channelClass, @NotNull @NotNull ExecutorService executorService)
Initialize EventLoopGroup
.
channelClass
- a Class
objectexecutorService
- a ExecutorService
objectEventLoopGroup
objectprotected abstract CompletableFuture<io.netty.channel.Channel> newChannel(Object data)
newChannel.
data
- a Object
objectCompletableFuture
objectpublic final CompletableFuture<io.netty.channel.Channel> create(Object data)
create.
create
in interface NettyChannelFactory
data
- a Object
objectCompletableFuture
objectprotected void configureBootstrap(io.netty.bootstrap.Bootstrap bootstrap)
configureBootstrap.
bootstrap
- a Bootstrap
objectpublic final CompletableFuture<io.netty.channel.Channel> create(Object data, io.netty.channel.EventLoop eventLoop)
create.
create
in interface NettyChannelFactory
data
- a Object
objecteventLoop
- a EventLoop
objectCompletableFuture
objectprotected io.netty.channel.RecvByteBufAllocator createRecvByteBufAllocator()
createRecvByteBufAllocator.
RecvByteBufAllocator
objectpublic TransportType getTransportType()
getTransportType.
getTransportType
in interface NettyChannelFactory
TransportType
objectpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public NettyChannelInitializer getChannelInitializer()
getChannelInitializer.
getChannelInitializer
in interface NettyChannelFactory
NettyChannelInitializer
objectpublic void setChannelInitializer(NettyChannelInitializer channelInitializer)
setChannelInitializer.
setChannelInitializer
in interface NettyChannelFactory
channelInitializer
- a NettyChannelInitializer
objectpublic NettyPropertyResolver getResolver()
getResolver.
getResolver
in interface NettyChannelFactory
NettyPropertyResolver
objectpublic void setResolver(NettyPropertyResolver resolver)
setResolver.
setResolver
in interface NettyChannelFactory
resolver
- a NettyPropertyResolver
objectpublic io.netty.channel.EventLoopGroup getExecutor()
getExecutor.
getExecutor
in interface NettyChannelFactory
EventLoopGroup
objectpublic io.netty.bootstrap.Bootstrap getBootstrap()
getBootstrap.
getBootstrap
in interface NettyChannelFactory
Bootstrap
objectpublic Options getOptions()
getOptions.
getOptions
in interface NettyChannelFactory
Options
objectCopyright © 2016–2024. All rights reserved.