Methods Summary |
---|
public boolean | equals(java.lang.Object obj)
if (obj == this.sel) return true;
if (obj instanceof Selector) {
return ((Selector) obj).equals(this.sel);
}
return false;
|
public java.nio.channels.Selector | getSelector()
return sel;
|
public int | hashCode()
return this.sel.hashCode();
|
protected void | implCloseSelector()
if ( logger.isLoggable(Level.FINER) ) {
logger.log(Level.FINER, "Selector is getting closed :" + sel);
}
sel.close();
|
public java.util.Set | keys()
if (wrapSelectionKeys &&
ASSocketFacadeUtils.getASSocketService().isServerStartingUp(port)) {
return new ASSet(sel.keys(), this);
} else {
return sel.keys();
}
|
protected java.nio.channels.SelectionKey | register(java.nio.channels.spi.AbstractSelectableChannel ac, int ops, java.lang.Object obj)
try {
if (ac instanceof ASChannel) {
ASChannel asc = (ASChannel) ac;
SelectableChannel sc = asc.getActualChannel();
if (ac instanceof ASServerSocketChannel &&
ops == SelectionKey.OP_ACCEPT) {
this.port = ((ASServerSocketChannel)ac).getPortNumber();
wrapSelectionKeys = true;
}
return sc.register(sel, ops, obj);
} else {
if ( logger.isLoggable(Level.FINEST) ) {
logger.log(java.util.logging.Level.FINEST,
"In ASSelector.register channel class = "
+ ac.getClass().getName(), new Exception());
}
return ac.register(sel, ops, obj);
}
} catch (ClosedChannelException ce) {
throw new RuntimeException (ce);
}
|
public int | select(long l)
return sel.select(l);
|
public int | select()
return sel.select();
|
public int | selectNow()
return sel.selectNow();
|
public java.util.Set | selectedKeys()
if (wrapSelectionKeys &&
ASSocketFacadeUtils.getASSocketService().isServerStartingUp(port)) {
return new ASSet(sel.selectedKeys(), this);
} else {
return sel.selectedKeys();
}
|
boolean | wakenUp()
boolean result = wakenup;
wakenup = false;
return result;
|
public java.nio.channels.Selector | wakeup()
wakenup = true;
return sel.wakeup();
|
public java.lang.Object | wrapIfNecessary(java.lang.Object next)
SelectionKey selKey = (SelectionKey) next;
if ((selKey.interestOps() & SelectionKey.OP_ACCEPT) != 0) {
ASServerSocketChannel channel = new ASServerSocketChannel(
(ServerSocketChannel) selKey.channel(), this.sel.provider());
SelectionKey key = new ASSelectionKey(channel, selKey, this);
key.attach(selKey.attachment());
return key;
} else {
return selKey;
}
|