Methods Summary |
---|
public void | addListener(AEProxyConnectionListener l)
listeners.add(l);
|
public void | cancelConnectSelect(java.nio.channels.SocketChannel sc)
server.cancelConnectSelect( sc );
|
public void | cancelReadSelect(java.nio.channels.SocketChannel sc)
server.cancelReadSelect( sc );
|
public void | cancelWriteSelect(java.nio.channels.SocketChannel sc)
server.cancelWriteSelect( sc );
|
public void | close()
is_closed = true;
try{
try{
cancelReadSelect( source_channel );
cancelWriteSelect( source_channel );
source_channel.close();
}catch( Throwable e ){
Debug.printStackTrace(e);
}
for (int i=0;i<listeners.size();i++){
try{
((AEProxyConnectionListener)listeners.get(i)).connectionClosed( this );
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
}finally{
server.close( this );
}
|
protected boolean | connect(java.nio.channels.SocketChannel sc)
try{
return( proxy_connect_state.connect(sc));
}catch( Throwable e ){
failed(e);
return( false );
}
|
public void | failed(java.lang.Throwable reason)
try{
if (Logger.isEnabled())
Logger.log(new LogEvent(LOGID, "AEProxyProcessor: " + getName()
+ " failed", reason));
close();
}catch( Throwable e ){
Debug.printStackTrace(e);
}
|
public java.lang.String | getName()
String name = source_channel.socket().getInetAddress() + ":" + source_channel.socket().getPort() + " -> ";
return( name );
|
public java.nio.channels.SocketChannel | getSourceChannel()
return( source_channel );
|
protected java.lang.String | getStateString()
return( getName() + "connected = " + is_connected + ", closed = " + is_closed + ", " +
"chan: reg = " + source_channel.isRegistered() + ", open = " + source_channel.isOpen() + ", " +
"read:" + (proxy_read_state == null?null:proxy_read_state.getStateName()) + ", " +
"write:" + (proxy_write_state == null?null:proxy_write_state.getStateName()) + ", " +
"connect:" + (proxy_connect_state == null?null:proxy_connect_state.getStateName()));
|
protected long | getTimeStamp()
return( time_stamp );
|
public boolean | isClosed()
return( is_closed );
|
protected boolean | isConnected()
return( is_connected );
|
protected boolean | read(java.nio.channels.SocketChannel sc)
try{
return( proxy_read_state.read(sc));
}catch( Throwable e ){
failed(e);
return( false );
}
|
public void | removeListener(AEProxyConnectionListener l)
listeners.remove(l);
|
public void | requestConnectSelect(java.nio.channels.SocketChannel sc)
server.requestConnectSelect( this, sc );
|
public void | requestReadSelect(java.nio.channels.SocketChannel sc)
server.requestReadSelect( this, sc );
|
public void | requestWriteSelect(java.nio.channels.SocketChannel sc)
server.requestWriteSelect( this, sc );
|
public void | setConnectState(AEProxyState state)
proxy_connect_state = state;
|
public void | setConnected()
setTimeStamp();
is_connected = true;
|
public void | setReadState(AEProxyState state)
proxy_read_state = state;
|
public void | setTimeStamp()
time_stamp = SystemTime.getCurrentTime();
|
public void | setWriteState(AEProxyState state)
proxy_write_state = state;
|
protected boolean | write(java.nio.channels.SocketChannel sc)
try{
return( proxy_write_state.write(sc));
}catch( Throwable e ){
failed(e);
return( false );
}
|