|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aelitis.azureus.core.networkmanager.VirtualChannelSelector
public class VirtualChannelSelector
Nested Class Summary | |
---|---|
static interface |
VirtualChannelSelector.VirtualAbstractSelectorListener
|
static interface |
VirtualChannelSelector.VirtualAcceptSelectorListener
|
static interface |
VirtualChannelSelector.VirtualSelectorListener
Listener for notification upon socket channel selection. |
Field Summary | |
---|---|
static int |
OP_ACCEPT
|
static int |
OP_CONNECT
|
static int |
OP_READ
|
static int |
OP_WRITE
|
Constructor Summary | |
---|---|
VirtualChannelSelector(java.lang.String name,
int interest_op,
boolean pause_after_select)
Create a new virtual selectable-channel selector, selecting over the given interest-op. |
Method Summary | |
---|---|
void |
cancel(java.nio.channels.spi.AbstractSelectableChannel channel)
Cancel the selection operations for the given channel. |
void |
destroy()
|
void |
enableSafeSelectionMode()
|
java.lang.String |
getName()
|
boolean |
isDestroyed()
|
boolean |
isSafeSelectionModeEnabled()
|
void |
pauseSelects(java.nio.channels.spi.AbstractSelectableChannel channel)
Pause selection operations for the given channel |
void |
register(java.nio.channels.ServerSocketChannel channel,
VirtualChannelSelector.VirtualAcceptSelectorListener listener,
java.lang.Object attachment)
|
void |
register(java.nio.channels.SocketChannel channel,
VirtualChannelSelector.VirtualSelectorListener listener,
java.lang.Object attachment)
|
protected void |
registerSupport(java.nio.channels.spi.AbstractSelectableChannel channel,
VirtualChannelSelector.VirtualAbstractSelectorListener listener,
java.lang.Object attachment)
Register the given selectable channel, using the given listener for notification of completed select operations. |
void |
resumeSelects(java.nio.channels.spi.AbstractSelectableChannel channel)
Resume selection operations for the given channel |
int |
select(long timeout)
Run a virtual select() operation, with the given selection timeout value; (1) cancellations are processed (2) the select operation is performed; (3) listener notification of completed selects (4) new registrations are processed |
void |
selectFailure(VirtualChannelSelector.VirtualAbstractSelectorListener listener,
java.nio.channels.spi.AbstractSelectableChannel sc,
java.lang.Object attachment,
java.lang.Throwable msg)
|
boolean |
selectSuccess(VirtualChannelSelector.VirtualAbstractSelectorListener listener,
java.nio.channels.spi.AbstractSelectableChannel sc,
java.lang.Object attachment)
|
void |
setRandomiseKeys(boolean _rk)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OP_ACCEPT
public static final int OP_CONNECT
public static final int OP_READ
public static final int OP_WRITE
Constructor Detail |
---|
public VirtualChannelSelector(java.lang.String name, int interest_op, boolean pause_after_select)
interest_op
- operation set of OP_CONNECT, OP_ACCEPT, OP_READ, or OP_WRITEpause_after_select
- whether or not to auto-disable interest op after selectMethod Detail |
---|
public java.lang.String getName()
public void register(java.nio.channels.SocketChannel channel, VirtualChannelSelector.VirtualSelectorListener listener, java.lang.Object attachment)
public void register(java.nio.channels.ServerSocketChannel channel, VirtualChannelSelector.VirtualAcceptSelectorListener listener, java.lang.Object attachment)
protected void registerSupport(java.nio.channels.spi.AbstractSelectableChannel channel, VirtualChannelSelector.VirtualAbstractSelectorListener listener, java.lang.Object attachment)
channel
- socket to listen forlistener
- op-complete listenerattachment
- object to be passed back with listener notificationpublic void pauseSelects(java.nio.channels.spi.AbstractSelectableChannel channel)
channel
- to pausepublic void resumeSelects(java.nio.channels.spi.AbstractSelectableChannel channel)
channel
- to resumepublic void cancel(java.nio.channels.spi.AbstractSelectableChannel channel)
channel
- channel originally registeredpublic void setRandomiseKeys(boolean _rk)
public int select(long timeout)
timeout
- in ms; if zero, block indefinitely
public void destroy()
public boolean isDestroyed()
public boolean isSafeSelectionModeEnabled()
public void enableSafeSelectionMode()
public boolean selectSuccess(VirtualChannelSelector.VirtualAbstractSelectorListener listener, java.nio.channels.spi.AbstractSelectableChannel sc, java.lang.Object attachment)
public void selectFailure(VirtualChannelSelector.VirtualAbstractSelectorListener listener, java.nio.channels.spi.AbstractSelectableChannel sc, java.lang.Object attachment, java.lang.Throwable msg)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |