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

java.lang.Object
  extended by com.aelitis.azureus.core.proxy.impl.AEProxyConnectionImpl
All Implemented Interfaces:
AEProxyConnection

public class AEProxyConnectionImpl
extends Object
implements AEProxyConnection

Author:
parg

Field Summary
protected  boolean is_closed
           
protected  boolean is_connected
           
protected  List listeners
           
protected  AEProxyState proxy_connect_state
           
protected  AEProxyState proxy_read_state
           
protected  AEProxyState proxy_write_state
           
protected  AEProxyImpl server
           
protected  SocketChannel source_channel
           
protected  long time_stamp
           
 
Constructor Summary
protected AEProxyConnectionImpl(AEProxyImpl _server, SocketChannel _socket, AEProxyHandler _handler)
           
 
Method Summary
 void addListener(AEProxyConnectionListener l)
           
 void cancelConnectSelect(SocketChannel sc)
           
 void cancelReadSelect(SocketChannel sc)
           
 void cancelWriteSelect(SocketChannel sc)
           
 void close()
          close the connection
protected  boolean connect(SocketChannel sc)
           
 void failed(Throwable reason)
          indicate that the connection has failed
 String getName()
           
 SocketChannel getSourceChannel()
          returns the non-blocking channel associated with the initiator of this proxy connection
protected  String getStateString()
           
protected  long getTimeStamp()
           
 boolean isClosed()
           
protected  boolean isConnected()
           
protected  boolean read(SocketChannel sc)
           
 void removeListener(AEProxyConnectionListener l)
           
 void requestConnectSelect(SocketChannel sc)
           
 void requestReadSelect(SocketChannel sc)
           
 void requestWriteSelect(SocketChannel sc)
           
 void setConnected()
          marks the transition between connecting and connected
 void setConnectState(AEProxyState state)
           
 void setReadState(AEProxyState state)
           
 void setTimeStamp()
          marks the last time that something happened on the connection for read timeout purposes
 void setWriteState(AEProxyState state)
           
protected  boolean write(SocketChannel sc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected final AEProxyImpl server

source_channel

protected final SocketChannel source_channel

proxy_read_state

protected volatile AEProxyState proxy_read_state

proxy_write_state

protected volatile AEProxyState proxy_write_state

proxy_connect_state

protected volatile AEProxyState proxy_connect_state

time_stamp

protected long time_stamp

is_connected

protected boolean is_connected

is_closed

protected boolean is_closed

listeners

protected final List listeners
Constructor Detail

AEProxyConnectionImpl

protected AEProxyConnectionImpl(AEProxyImpl _server,
                                SocketChannel _socket,
                                AEProxyHandler _handler)
Method Detail

getName

public String getName()
Specified by:
getName in interface AEProxyConnection

getSourceChannel

public SocketChannel getSourceChannel()
Description copied from interface: AEProxyConnection
returns the non-blocking channel associated with the initiator of this proxy connection

Specified by:
getSourceChannel in interface AEProxyConnection
Returns:

setReadState

public void setReadState(AEProxyState state)
Specified by:
setReadState in interface AEProxyConnection

setWriteState

public void setWriteState(AEProxyState state)
Specified by:
setWriteState in interface AEProxyConnection

setConnectState

public void setConnectState(AEProxyState state)
Specified by:
setConnectState in interface AEProxyConnection

read

protected boolean read(SocketChannel sc)

write

protected boolean write(SocketChannel sc)

connect

protected boolean connect(SocketChannel sc)

requestWriteSelect

public void requestWriteSelect(SocketChannel sc)
Specified by:
requestWriteSelect in interface AEProxyConnection

cancelWriteSelect

public void cancelWriteSelect(SocketChannel sc)
Specified by:
cancelWriteSelect in interface AEProxyConnection

requestConnectSelect

public void requestConnectSelect(SocketChannel sc)
Specified by:
requestConnectSelect in interface AEProxyConnection

cancelConnectSelect

public void cancelConnectSelect(SocketChannel sc)
Specified by:
cancelConnectSelect in interface AEProxyConnection

requestReadSelect

public void requestReadSelect(SocketChannel sc)
Specified by:
requestReadSelect in interface AEProxyConnection

cancelReadSelect

public void cancelReadSelect(SocketChannel sc)
Specified by:
cancelReadSelect in interface AEProxyConnection

failed

public void failed(Throwable reason)
Description copied from interface: AEProxyConnection
indicate that the connection has failed

Specified by:
failed in interface AEProxyConnection

close

public void close()
Description copied from interface: AEProxyConnection
close the connection

Specified by:
close in interface AEProxyConnection

isClosed

public boolean isClosed()
Specified by:
isClosed in interface AEProxyConnection

setConnected

public void setConnected()
Description copied from interface: AEProxyConnection
marks the transition between connecting and connected

Specified by:
setConnected in interface AEProxyConnection

isConnected

protected boolean isConnected()

setTimeStamp

public void setTimeStamp()
Description copied from interface: AEProxyConnection
marks the last time that something happened on the connection for read timeout purposes

Specified by:
setTimeStamp in interface AEProxyConnection

getTimeStamp

protected long getTimeStamp()

addListener

public void addListener(AEProxyConnectionListener l)
Specified by:
addListener in interface AEProxyConnection

removeListener

public void removeListener(AEProxyConnectionListener l)
Specified by:
removeListener in interface AEProxyConnection

getStateString

protected String getStateString()