Class NioServerBoss
- java.lang.Object
-
- org.jboss.netty.channel.socket.nio.NioServerBoss
-
- All Implemented Interfaces:
Runnable
,Boss
,NioSelector
public final class NioServerBoss extends Object implements Boss
Boss implementation which handles accepting of new connections
-
-
Field Summary
Fields Modifier and Type Field Description protected static InternalLogger
logger
Internal Netty logger.protected Selector
selector
The NIOSelector
.protected Thread
thread
If this worker has been started thread will be a reference to the thread used when starting.protected AtomicBoolean
wakenUp
Boolean that controls determines if a blocked Selector.select should break out of its selection process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
cleanUpCancelledKeys()
protected void
close(SelectionKey k)
protected Runnable
createRegisterTask(Channel channel, ChannelFuture future)
protected void
increaseCancelledKeys()
protected boolean
isIoThread()
protected ThreadRenamingRunnable
newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner)
protected void
process(Selector selector)
void
rebuildSelector()
void
register(Channel channel, ChannelFuture future)
protected void
registerTask(Runnable task)
void
run()
protected int
select(Selector selector)
void
shutdown()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.netty.channel.socket.nio.NioSelector
rebuildSelector, register, shutdown
-
-
-
-
Field Detail
-
logger
protected static final InternalLogger logger
Internal Netty logger.
-
thread
protected volatile Thread thread
If this worker has been started thread will be a reference to the thread used when starting. i.e. the current thread when the run method is executed.
-
wakenUp
protected final AtomicBoolean wakenUp
Boolean that controls determines if a blocked Selector.select should break out of its selection process. In our case we use a timeone for the select method and the select method will block for that time unless waken up.
-
-
Method Detail
-
close
protected void close(SelectionKey k)
-
process
protected void process(Selector selector)
-
select
protected int select(Selector selector) throws IOException
- Throws:
IOException
-
newThreadRenamingRunnable
protected ThreadRenamingRunnable newThreadRenamingRunnable(int id, ThreadNameDeterminer determiner)
-
createRegisterTask
protected Runnable createRegisterTask(Channel channel, ChannelFuture future)
-
register
public void register(Channel channel, ChannelFuture future)
- Specified by:
register
in interfaceNioSelector
-
registerTask
protected final void registerTask(Runnable task)
-
isIoThread
protected final boolean isIoThread()
-
rebuildSelector
public void rebuildSelector()
Description copied from interface:NioSelector
- Specified by:
rebuildSelector
in interfaceNioSelector
-
increaseCancelledKeys
protected final void increaseCancelledKeys()
-
cleanUpCancelledKeys
protected final boolean cleanUpCancelledKeys() throws IOException
- Throws:
IOException
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceNioSelector
-
-