com.aelitis.azureus.core.proxy.impl
Class AEProxyImpl

java.lang.Object
  extended by com.aelitis.azureus.core.proxy.impl.AEProxyImpl
All Implemented Interfaces:
VirtualChannelSelector.VirtualAbstractSelectorListener, VirtualChannelSelector.VirtualSelectorListener, AEProxy

public class AEProxyImpl
extends Object
implements AEProxy, VirtualChannelSelector.VirtualSelectorListener

Author:
parg

Constructor Summary
AEProxyImpl(int _port, long _connect_timeout, long _read_timeout, AEProxyHandler _proxy_handler)
           
 
Method Summary
protected  void acceptLoop(ServerSocketChannel ssc)
           
protected  void cancelConnectSelect(SocketChannel sc)
           
protected  void cancelReadSelect(SocketChannel sc)
           
protected  void cancelWriteSelect(SocketChannel sc)
           
protected  void checkTimeouts()
           
protected  void close(AEProxyConnectionImpl processor)
           
 void destroy()
           
 int getPort()
           
protected  void requestConnectSelect(AEProxyConnectionImpl processor, SocketChannel sc)
           
protected  void requestReadSelect(AEProxyConnectionImpl processor, SocketChannel sc)
           
protected  void requestWriteSelect(AEProxyConnectionImpl processor, SocketChannel sc)
           
 void selectFailure(VirtualChannelSelector selector, SocketChannel sc, Object attachment, Throwable msg)
          Called when a channel selection fails.
protected  void selectLoop(VirtualChannelSelector selector)
           
 boolean selectSuccess(VirtualChannelSelector selector, SocketChannel sc, Object attachment)
          Called when a channel is successfully selected for readyness.
 void setAllowExternalConnections(boolean permit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AEProxyImpl

public AEProxyImpl(int _port,
                   long _connect_timeout,
                   long _read_timeout,
                   AEProxyHandler _proxy_handler)
            throws AEProxyException
Throws:
AEProxyException
Method Detail

setAllowExternalConnections

public void setAllowExternalConnections(boolean permit)
Specified by:
setAllowExternalConnections in interface AEProxy

acceptLoop

protected void acceptLoop(ServerSocketChannel ssc)

close

protected void close(AEProxyConnectionImpl processor)

selectLoop

protected void selectLoop(VirtualChannelSelector selector)

checkTimeouts

protected void checkTimeouts()

requestWriteSelect

protected void requestWriteSelect(AEProxyConnectionImpl processor,
                                  SocketChannel sc)

cancelWriteSelect

protected void cancelWriteSelect(SocketChannel sc)

requestReadSelect

protected void requestReadSelect(AEProxyConnectionImpl processor,
                                 SocketChannel sc)

cancelReadSelect

protected void cancelReadSelect(SocketChannel sc)

requestConnectSelect

protected void requestConnectSelect(AEProxyConnectionImpl processor,
                                    SocketChannel sc)

cancelConnectSelect

protected void cancelConnectSelect(SocketChannel sc)

selectSuccess

public boolean selectSuccess(VirtualChannelSelector selector,
                             SocketChannel sc,
                             Object attachment)
Description copied from interface: VirtualChannelSelector.VirtualSelectorListener
Called when a channel is successfully selected for readyness.

Specified by:
selectSuccess in interface VirtualChannelSelector.VirtualSelectorListener
attachment - originally given with the channel's registration
Returns:
indicator of whether or not any 'progress' was made due to this select null -> progress made, String -> location of non progress e.g. read-select -> read >0 bytes, write-select -> wrote > 0 bytes

selectFailure

public void selectFailure(VirtualChannelSelector selector,
                          SocketChannel sc,
                          Object attachment,
                          Throwable msg)
Description copied from interface: VirtualChannelSelector.VirtualSelectorListener
Called when a channel selection fails.

Specified by:
selectFailure in interface VirtualChannelSelector.VirtualSelectorListener
msg - failure message

getPort

public int getPort()
Specified by:
getPort in interface AEProxy

destroy

public void destroy()
Specified by:
destroy in interface AEProxy