class KQSelector
extends java.nio.channels.spi.AbstractSelector
Selector
that uses the BSD (including MacOS)
kqueue(2) mechanismModifier and Type | Class and Description |
---|---|
private static class |
KQSelector.Descriptor |
private static class |
KQSelector.EventIO |
private static class |
KQSelector.EventLayout |
Modifier and Type | Field and Description |
---|---|
private jnr.ffi.Pointer |
changebuf |
private static boolean |
DEBUG |
private java.util.Map<java.lang.Integer,KQSelector.Descriptor> |
descriptors |
private static int |
EV_ADD |
private static int |
EV_CLEAR |
private static int |
EV_DELETE |
private static int |
EV_DISABLE |
private static int |
EV_ENABLE |
private jnr.ffi.Pointer |
eventbuf |
private static int |
EVFILT_READ |
private static int |
EVFILT_WRITE |
private KQSelector.EventIO |
io |
private int |
kqfd |
private static int |
MAX_EVENTS |
private int[] |
pipefd |
private java.lang.Object |
regLock |
private jnr.ffi.Runtime |
runtime |
private java.util.Set<java.nio.channels.SelectionKey> |
selected |
private Native.Timespec |
ZERO_TIMESPEC |
Constructor and Description |
---|
KQSelector(NativeSelectorProvider provider) |
Modifier and Type | Method and Description |
---|---|
private int |
handleCancelledKeys() |
private void |
handleChangedKey(KQSelector.Descriptor changed) |
protected void |
implCloseSelector() |
(package private) void |
interestOps(KQSelectionKey k,
int ops) |
java.util.Set<java.nio.channels.SelectionKey> |
keys() |
private int |
poll(long timeout) |
protected java.nio.channels.SelectionKey |
register(java.nio.channels.spi.AbstractSelectableChannel ch,
int ops,
java.lang.Object att) |
int |
select() |
int |
select(long timeout) |
java.util.Set<java.nio.channels.SelectionKey> |
selectedKeys() |
int |
selectNow() |
java.nio.channels.Selector |
wakeup() |
private void |
wakeupReceived() |
private static final boolean DEBUG
private static final int MAX_EVENTS
private static final int EVFILT_READ
private static final int EVFILT_WRITE
private static final int EV_ADD
private static final int EV_DELETE
private static final int EV_ENABLE
private static final int EV_DISABLE
private static final int EV_CLEAR
private int kqfd
private final jnr.ffi.Runtime runtime
private final jnr.ffi.Pointer changebuf
private final jnr.ffi.Pointer eventbuf
private final KQSelector.EventIO io
private final int[] pipefd
private final java.lang.Object regLock
private final java.util.Map<java.lang.Integer,KQSelector.Descriptor> descriptors
private final java.util.Set<java.nio.channels.SelectionKey> selected
private final Native.Timespec ZERO_TIMESPEC
public KQSelector(NativeSelectorProvider provider)
protected void implCloseSelector() throws java.io.IOException
implCloseSelector
in class java.nio.channels.spi.AbstractSelector
java.io.IOException
protected java.nio.channels.SelectionKey register(java.nio.channels.spi.AbstractSelectableChannel ch, int ops, java.lang.Object att)
register
in class java.nio.channels.spi.AbstractSelector
public java.util.Set<java.nio.channels.SelectionKey> keys()
keys
in class java.nio.channels.Selector
public java.util.Set<java.nio.channels.SelectionKey> selectedKeys()
selectedKeys
in class java.nio.channels.Selector
public int selectNow() throws java.io.IOException
selectNow
in class java.nio.channels.Selector
java.io.IOException
public int select(long timeout) throws java.io.IOException
select
in class java.nio.channels.Selector
java.io.IOException
public int select() throws java.io.IOException
select
in class java.nio.channels.Selector
java.io.IOException
private int poll(long timeout)
private int handleCancelledKeys()
private void handleChangedKey(KQSelector.Descriptor changed)
private void wakeupReceived()
public java.nio.channels.Selector wakeup()
wakeup
in class java.nio.channels.Selector
void interestOps(KQSelectionKey k, int ops)