Class NioSocketAcceptor.ServerSocketChannelIterator
- java.lang.Object
-
- org.apache.mina.transport.socket.nio.NioSocketAcceptor.ServerSocketChannelIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.nio.channels.ServerSocketChannel>
- Enclosing class:
- NioSocketAcceptor
private static class NioSocketAcceptor.ServerSocketChannelIterator extends java.lang.Object implements java.util.Iterator<java.nio.channels.ServerSocketChannel>Defines an iterator for the selected-key Set returned by the selector.selectedKeys(). It replaces the SelectionKey operator.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Iterator<java.nio.channels.SelectionKey>iteratorThe selected-key iterator
-
Constructor Summary
Constructors Modifier Constructor Description privateServerSocketChannelIterator(java.util.Collection<java.nio.channels.SelectionKey> selectedKeys)Build a SocketChannel iterator which will return a SocketChannel instead of a SelectionKey.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tells if there are more SockectChannel left in the iteratorjava.nio.channels.ServerSocketChannelnext()Get the next SocketChannel in the operator we have built from the selected-key et for this selector.voidremove()Remove the current SocketChannel from the iterator
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Tells if there are more SockectChannel left in the iterator- Specified by:
hasNextin interfacejava.util.Iterator<java.nio.channels.ServerSocketChannel>- Returns:
trueif there is at least one more SockectChannel object to read
-
next
public java.nio.channels.ServerSocketChannel next()
Get the next SocketChannel in the operator we have built from the selected-key et for this selector.- Specified by:
nextin interfacejava.util.Iterator<java.nio.channels.ServerSocketChannel>- Returns:
- The next SocketChannel in the iterator
-
remove
public void remove()
Remove the current SocketChannel from the iterator- Specified by:
removein interfacejava.util.Iterator<java.nio.channels.ServerSocketChannel>
-
-