public abstract class SelectorManager extends AbstractLifeCycle implements Dumpable
| Modifier and Type | Class and Description |
|---|---|
class |
SelectorManager.SelectSet |
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
static Logger |
LOG |
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING| Constructor and Description |
|---|
SelectorManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connectionFailed(java.nio.channels.SocketChannel channel,
java.lang.Throwable ex,
java.lang.Object attachment) |
abstract boolean |
dispatch(java.lang.Runnable task) |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
protected abstract void |
endPointClosed(SelectChannelEndPoint endpoint) |
protected abstract void |
endPointOpened(SelectChannelEndPoint endpoint) |
protected abstract void |
endPointUpgraded(ConnectedEndPoint endpoint,
Connection oldConnection) |
long |
getLowResourcesConnections() |
long |
getLowResourcesMaxIdleTime() |
long |
getMaxIdleTime() |
int |
getSelectorPriorityDelta() |
SelectorManager.SelectSet |
getSelectSet(int i) |
int |
getSelectSets() |
boolean |
isDeferringInterestedOps0() |
abstract AsyncConnection |
newConnection(java.nio.channels.SocketChannel channel,
AsyncEndPoint endpoint,
java.lang.Object attachment) |
protected abstract SelectChannelEndPoint |
newEndPoint(java.nio.channels.SocketChannel channel,
SelectorManager.SelectSet selectSet,
java.nio.channels.SelectionKey sKey)
Create a new end point
|
void |
register(java.nio.channels.ServerSocketChannel acceptChannel)
Register a
ServerSocketChannel |
void |
register(java.nio.channels.SocketChannel channel)
Register a channel
|
void |
register(java.nio.channels.SocketChannel channel,
java.lang.Object att)
Register a channel
|
void |
setDeferringInterestedOps0(boolean deferringInterestedOps0) |
void |
setLowResourcesConnections(long lowResourcesConnections)
Set the number of connections, which if exceeded places this manager in low resources state.
|
void |
setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime) |
void |
setMaxIdleTime(long maxIdleTime) |
void |
setSelectorPriorityDelta(int delta)
Set the selector thread priorty delta.
|
void |
setSelectSets(int selectSets) |
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic static final Logger LOG
public void setMaxIdleTime(long maxIdleTime)
maxIdleTime - The maximum period in milli seconds that a connection may be idle before it is closed.setLowResourcesMaxIdleTime(long)public void setSelectSets(int selectSets)
selectSets - number of select sets to createpublic long getMaxIdleTime()
public int getSelectSets()
public SelectorManager.SelectSet getSelectSet(int i)
i - public void register(java.nio.channels.SocketChannel channel,
java.lang.Object att)
channel - att - Attached Objectpublic void register(java.nio.channels.SocketChannel channel)
channel - public void register(java.nio.channels.ServerSocketChannel acceptChannel)
ServerSocketChannelacceptChannel - public int getSelectorPriorityDelta()
public void setSelectorPriorityDelta(int delta)
delta - The value to add to the selector thread priority.public long getLowResourcesConnections()
public void setLowResourcesConnections(long lowResourcesConnections)
lowResourcesConnections - the number of connectionssetLowResourcesMaxIdleTime(long)public long getLowResourcesMaxIdleTime()
public void setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime)
lowResourcesMaxIdleTime - the period in ms that a connection is allowed to be idle when this SelectSet has more connections than getLowResourcesConnections()setMaxIdleTime(long)public abstract boolean dispatch(java.lang.Runnable task)
protected void doStart()
throws java.lang.Exception
doStart in class AbstractLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.Exceptionprotected abstract void endPointClosed(SelectChannelEndPoint endpoint)
endpoint - protected abstract void endPointOpened(SelectChannelEndPoint endpoint)
endpoint - protected abstract void endPointUpgraded(ConnectedEndPoint endpoint, Connection oldConnection)
public abstract AsyncConnection newConnection(java.nio.channels.SocketChannel channel, AsyncEndPoint endpoint, java.lang.Object attachment)
protected abstract SelectChannelEndPoint newEndPoint(java.nio.channels.SocketChannel channel, SelectorManager.SelectSet selectSet, java.nio.channels.SelectionKey sKey) throws java.io.IOException
channel - selectSet - sKey - the selection keySelectChannelEndPointjava.io.IOExceptionprotected void connectionFailed(java.nio.channels.SocketChannel channel,
java.lang.Throwable ex,
java.lang.Object attachment)
public void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
public boolean isDeferringInterestedOps0()
public void setDeferringInterestedOps0(boolean deferringInterestedOps0)
Copyright © 2013 FuseSource, Corp.. All Rights Reserved.