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 parentChannel
of thisEmbeddedChannel
.- Parameters:
parent
- the parentChannel
of thisEmbeddedChannel
.- Returns:
- This builder
-
channelId
public EmbeddedChannel.Builder channelId(ChannelId channelId)
TheChannelId
that will be used to identify this channel.- Parameters:
channelId
- theChannelId
that will be used to identify this channel- Returns:
- This builder
-
register
public EmbeddedChannel.Builder register(boolean register)
true
if thisChannel
is registered to theEventLoop
in the constructor. Iffalse
the user will need to callEmbeddedChannel.register()
.- Parameters:
register
-true
if thisChannel
is registered to theEventLoop
in the constructor. Iffalse
the user will need to callEmbeddedChannel.register()
.- Returns:
- This builder
-
hasDisconnect
public EmbeddedChannel.Builder hasDisconnect(boolean hasDisconnect)
false
if thisChannel
will delegateEmbeddedChannel.disconnect()
toEmbeddedChannel.close()
,true
otherwise.- Parameters:
hasDisconnect
-false
if thisChannel
will delegateEmbeddedChannel.disconnect()
toEmbeddedChannel.close()
,true
otherwise- Returns:
- This builder
-
handlers
public EmbeddedChannel.Builder handlers(ChannelHandler... handlers)
TheChannelHandler
s which will be added to theChannelPipeline
.- Parameters:
handlers
- theChannelHandler
s which will be added to theChannelPipeline
- Returns:
- This builder
-
handlers
public EmbeddedChannel.Builder handlers(ChannelHandler handler)
TheChannelHandler
which will be added to theChannelPipeline
.- Parameters:
handler
- theChannelHandler
s which will be added to theChannelPipeline
- Returns:
- This builder
-
config
public EmbeddedChannel.Builder config(ChannelConfig config)
TheChannelConfig
which will be returned byEmbeddedChannel.config()
.- Parameters:
config
- theChannelConfig
which 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
-
-