public class NettyNetworkManager extends Object implements SynchronousNetworkManager<io.netty.channel.Channel>, AsynchronousNetworkManager<io.netty.channel.Channel>
SynchronousNetworkManager,
AsynchronousNetworkManager| Modifier and Type | Field and Description |
|---|---|
protected io.netty.bootstrap.Bootstrap |
bootstrap |
protected io.netty.channel.EventLoopGroup |
eventGroup |
| Constructor and Description |
|---|
NettyNetworkManager() |
NettyNetworkManager(io.netty.bootstrap.Bootstrap bootstrap) |
NettyNetworkManager(int threadCount) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shuts down the Network Manager, closing any registered channels.
|
void |
close(com.google.common.util.concurrent.FutureCallback<Void> callback)
Asynchronously shuts down the Network Manager, closing any registered channels.
|
io.netty.channel.Channel |
openChannel()
Opens and registers a new Network Channel.
|
void |
openChannel(com.google.common.util.concurrent.FutureCallback<io.netty.channel.Channel> callback)
Opens and registers a new Network Channel.
|
protected final io.netty.channel.EventLoopGroup eventGroup
protected final io.netty.bootstrap.Bootstrap bootstrap
public NettyNetworkManager()
public NettyNetworkManager(int threadCount)
public NettyNetworkManager(io.netty.bootstrap.Bootstrap bootstrap)
public io.netty.channel.Channel openChannel()
throws IOException,
IllegalStateException
openChannel in interface SynchronousNetworkManager<io.netty.channel.Channel>SynchronousNetworkChannelIllegalStateException - If manager is already closed.IOException - If an error occurs when creating the channel.public void openChannel(com.google.common.util.concurrent.FutureCallback<io.netty.channel.Channel> callback)
throws IllegalStateException
openChannel in interface AsynchronousNetworkManager<io.netty.channel.Channel>callback - The callback that is invoked when the channel is open.IllegalStateException - If manager is already closed.public void close()
throws IOException,
IllegalStateException
close in interface AutoCloseableclose in interface SynchronousNetworkManager<io.netty.channel.Channel>IllegalStateException - If manager is already closed.IOException - If any error occurs when closing the manager.public void close(com.google.common.util.concurrent.FutureCallback<Void> callback) throws IllegalStateException
close in interface AsynchronousNetworkManager<io.netty.channel.Channel>callback - The callback that is invoked when the manager is shut down.IllegalStateException - If manager is already closed.Copyright © 2017 TeleStax, Inc.. All Rights Reserved.