net.sf.jbaobab.io
Class ThreadedSocketPreparer
java.lang.Object
net.sf.jbaobab.io.AbstractManager<SocketChannel,SocketHandlerFactory>
net.sf.jbaobab.io.ThreadedSocketPreparer
- All Implemented Interfaces:
- Runnable, Manager<SocketChannel,SocketHandlerFactory>, Preparer<SocketAddress,SocketHandlerFactory>, SocketPreparer
public class ThreadedSocketPreparer
- extends AbstractManager<SocketChannel,SocketHandlerFactory>
- implements SocketPreparer
A SocketPreparer
that creates SocketHandler
instance on root
executor (obtained with
ExecutorPool.getRootExecutor()
).
- Author:
- Oakyoon Cha
- See Also:
SocketPreparer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
receiver
protected ChannelManager<SocketChannel> receiver
sender
protected ChannelManager<SocketChannel> sender
executor
protected ExecutorService executor
ThreadedSocketPreparer
public ThreadedSocketPreparer(ChannelManager<SocketChannel> receiver,
ChannelManager<SocketChannel> sender)
throws IOException
- Throws:
IOException
ThreadedSocketPreparer
public ThreadedSocketPreparer()
throws IOException
- Throws:
IOException
register
public SelectionKey register(SocketChannel channel,
SocketHandlerFactory factory)
- Specified by:
register
in interface Manager<SocketChannel,SocketHandlerFactory>
hold
public boolean hold(SocketChannel channel)
- Specified by:
hold
in interface Manager<SocketChannel,SocketHandlerFactory>
release
public boolean release(SocketChannel channel)
- Specified by:
release
in interface Manager<SocketChannel,SocketHandlerFactory>
prepare
public SelectionKey prepare(SocketAddress address,
SocketHandlerFactory factory)
- Specified by:
prepare
in interface Preparer<SocketAddress,SocketHandlerFactory>
manage
protected void manage(SelectionKey key,
SocketHandlerFactory factory)
- Specified by:
manage
in class AbstractManager<SocketChannel,SocketHandlerFactory>