org.mortbay.io.nio
Class SelectorManager
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.io.nio.SelectorManager
- All Implemented Interfaces:
- LifeCycle
public abstract class SelectorManager
- extends AbstractLifeCycle
The Selector Manager manages and number of SelectSets to allow
NIO scheduling to scale to large numbers of connections.
- Author:
- gregw
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SelectorManager
public SelectorManager()
getMaxIdleTime
public long getMaxIdleTime()
- Returns:
getSelectSets
public int getSelectSets()
isDelaySelectKeyUpdate
public boolean isDelaySelectKeyUpdate()
register
public SelectionKey register(ServerSocketChannel acceptChannel,
int op_accept)
throws ClosedChannelException
- Throws:
ClosedChannelException
doSelect
public void doSelect(int acceptorID)
throws IOException
- Throws:
IOException
setDelaySelectKeyUpdate
public void setDelaySelectKeyUpdate(boolean delaySelectKeyUpdate)
setMaxIdleTime
public void setMaxIdleTime(long maxIdleTime)
- Parameters:
maxIdleTime
-
setSelectSets
public void setSelectSets(int selectSets)
acceptChannel
protected abstract SocketChannel acceptChannel(SelectionKey key)
throws IOException
- Parameters:
key
-
- Returns:
-
- Throws:
IOException
dispatch
protected abstract boolean dispatch(Runnable task)
throws IOException
- Throws:
IOException
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class AbstractLifeCycle
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class AbstractLifeCycle
- Throws:
Exception
doStop
public void doStop(int i)
throws Exception
- Throws:
Exception
endPointClosed
protected abstract void endPointClosed(SelectChannelEndPoint endpoint)
- Parameters:
endpoint
-
endPointOpened
protected abstract void endPointOpened(SelectChannelEndPoint endpoint)
- Parameters:
endpoint
-
newConnection
protected abstract Connection newConnection(SocketChannel channel,
SelectChannelEndPoint endpoint)
newEndPoint
protected abstract SelectChannelEndPoint newEndPoint(SocketChannel channel,
SelectorManager.SelectSet selectSet,
SelectionKey sKey)
throws IOException
- Parameters:
channel
- selectSet
- sKey
-
- Returns:
-
- Throws:
IOException