public class ChannelRotater extends Object
| Constructor and Description | 
|---|
| ChannelRotater(Integer taskId,
              InetSocketAddress address)Constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addChannel(io.netty.channel.Channel channel)Add a channel to the rotation | 
| void | closeChannels(io.netty.channel.ChannelFutureListener channelFutureListener)Close the channels | 
| Iterable<io.netty.channel.Channel> | getChannels()Get a copy of the channels | 
| Integer | getTaskId() | 
| io.netty.channel.Channel | nextChannel()Get the next channel | 
| boolean | removeChannel(io.netty.channel.Channel channel)Remove the a channel | 
| int | size()Get the number of channels in this object | 
public ChannelRotater(Integer taskId, InetSocketAddress address)
taskId - Id of the task these channels as associated withaddress - Address these channels are associated withpublic Integer getTaskId()
public void addChannel(io.netty.channel.Channel channel)
channel - Channel to addpublic io.netty.channel.Channel nextChannel()
public boolean removeChannel(io.netty.channel.Channel channel)
channel - Channel to removepublic int size()
public void closeChannels(io.netty.channel.ChannelFutureListener channelFutureListener)
channelFutureListener - If desired, pass in a channel future listenerpublic Iterable<io.netty.channel.Channel> getChannels()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.