com.aelitis.azureus.core.networkmanager.impl.tcp
Class VirtualChannelSelectorImpl

java.lang.Object
  extended by com.aelitis.azureus.core.networkmanager.impl.tcp.VirtualChannelSelectorImpl

public class VirtualChannelSelectorImpl
extends Object

Provides a simplified and safe (selectable-channel) socket single-op selector.


Field Summary
protected  VirtualChannelSelector parent
           
protected  Selector selector
           
 
Constructor Summary
VirtualChannelSelectorImpl(VirtualChannelSelector _parent, int _interest_op, boolean _pause_after_select, boolean _randomise_keys)
           
 
Method Summary
 void cancel(AbstractSelectableChannel channel)
           
protected  void closeExistingSelector()
           
 void destroy()
          Note that you have to ensure that a select operation is performed on the normal select loop *after* destroying the selector to actually cause the destroy to occur
protected  Selector openNewSelector()
           
 void pauseSelects(AbstractSelectableChannel channel)
           
 void register(AbstractSelectableChannel channel, VirtualChannelSelector.VirtualAbstractSelectorListener listener, Object attachment)
           
 void resumeSelects(AbstractSelectableChannel channel)
           
 int select(long timeout)
           
 void setRandomiseKeys(boolean r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selector

protected Selector selector

parent

protected final VirtualChannelSelector parent
Constructor Detail

VirtualChannelSelectorImpl

public VirtualChannelSelectorImpl(VirtualChannelSelector _parent,
                                  int _interest_op,
                                  boolean _pause_after_select,
                                  boolean _randomise_keys)
Method Detail

openNewSelector

protected Selector openNewSelector()

setRandomiseKeys

public void setRandomiseKeys(boolean r)

pauseSelects

public void pauseSelects(AbstractSelectableChannel channel)

resumeSelects

public void resumeSelects(AbstractSelectableChannel channel)

cancel

public void cancel(AbstractSelectableChannel channel)

register

public void register(AbstractSelectableChannel channel,
                     VirtualChannelSelector.VirtualAbstractSelectorListener listener,
                     Object attachment)

select

public int select(long timeout)

destroy

public void destroy()
Note that you have to ensure that a select operation is performed on the normal select loop *after* destroying the selector to actually cause the destroy to occur


closeExistingSelector

protected void closeExistingSelector()