Package io.netty.channel.embedded
Class EmbeddedChannel.Builder
- java.lang.Object
-
- io.netty.channel.embedded.EmbeddedChannel.Builder
-
- Enclosing class:
- EmbeddedChannel
public static final class EmbeddedChannel.Builder extends java.lang.Object
-
-
Method Summary
-
-
-
Method Detail
-
parent
public EmbeddedChannel.Builder parent(Channel parent)
The parentChannelof thisEmbeddedChannel.- Parameters:
parent- the parentChannelof thisEmbeddedChannel.- Returns:
- This builder
-
channelId
public EmbeddedChannel.Builder channelId(ChannelId channelId)
TheChannelIdthat will be used to identify this channel.- Parameters:
channelId- theChannelIdthat will be used to identify this channel- Returns:
- This builder
-
register
public EmbeddedChannel.Builder register(boolean register)
trueif thisChannelis registered to theEventLoopin the constructor. Iffalsethe user will need to callEmbeddedChannel.register().- Parameters:
register-trueif thisChannelis registered to theEventLoopin the constructor. Iffalsethe user will need to callEmbeddedChannel.register().- Returns:
- This builder
-
hasDisconnect
public EmbeddedChannel.Builder hasDisconnect(boolean hasDisconnect)
falseif thisChannelwill delegateEmbeddedChannel.disconnect()toEmbeddedChannel.close(),trueotherwise.- Parameters:
hasDisconnect-falseif thisChannelwill delegateEmbeddedChannel.disconnect()toEmbeddedChannel.close(),trueotherwise- Returns:
- This builder
-
handlers
public EmbeddedChannel.Builder handlers(ChannelHandler... handlers)
TheChannelHandlers which will be added to theChannelPipeline.- Parameters:
handlers- theChannelHandlers which will be added to theChannelPipeline- Returns:
- This builder
-
handlers
public EmbeddedChannel.Builder handlers(ChannelHandler handler)
TheChannelHandlerwhich will be added to theChannelPipeline.- Parameters:
handler- theChannelHandlers which will be added to theChannelPipeline- Returns:
- This builder
-
config
public EmbeddedChannel.Builder config(ChannelConfig config)
TheChannelConfigwhich will be returned byEmbeddedChannel.config().- Parameters:
config- theChannelConfigwhich will be returned byEmbeddedChannel.config()- Returns:
- This builder
-
ticker
public EmbeddedChannel.Builder ticker(Ticker ticker)
Configure a custom ticker for this event loop.- Parameters:
ticker- The custom ticker- Returns:
- This builder
-
build
public EmbeddedChannel build()
Create the channel. If you wish to extendEmbeddedChannel, please use the#EmbeddedChannel(Builder)constructor instead.- Returns:
- The channel
-
-