FileDocCategorySizeDatePackage
ConnectionImpl.javaAPI DocAzureus 3.0.3.43121Mon Jun 25 16:48:32 BST 2007org.gudy.azureus2.pluginsimpl.local.network

ConnectionImpl

public class ConnectionImpl extends Object implements Connection

Fields Summary
private final com.aelitis.azureus.core.networkmanager.NetworkConnection
core_connection
private final OutgoingMessageQueueImpl
out_queue
private final IncomingMessageQueueImpl
in_queue
private final TransportImpl
tcp_transport
Constructors Summary
public ConnectionImpl(com.aelitis.azureus.core.networkmanager.NetworkConnection core_connection)

    this.core_connection = core_connection;
    this.out_queue = new OutgoingMessageQueueImpl( core_connection.getOutgoingMessageQueue() );
    this.in_queue = new IncomingMessageQueueImpl( core_connection.getIncomingMessageQueue() );
    this.tcp_transport = new TransportImpl( core_connection );
  
Methods Summary
public voidclose()

    core_connection.close();
  
public voidconnect(ConnectionListener listener)

    core_connection.connect( new com.aelitis.azureus.core.networkmanager.NetworkConnection.ConnectionListener() {
      public void connectStarted() { listener.connectStarted();  }
      
      public void connectSuccess( ByteBuffer remaining_initial_data) { listener.connectSuccess();  }
      
      public void connectFailure( Throwable failure_msg ) {  listener.connectFailure( failure_msg );  }
      public void exceptionThrown( Throwable error ) {  listener.exceptionThrown( error );  }
      
      public String
      getDescription()
      {
    	  return( "plugin connection: " + core_connection.getString());
      }
    });
  
public com.aelitis.azureus.core.networkmanager.NetworkConnectiongetCoreConnection()

    return core_connection;
  
public IncomingMessageQueuegetIncomingMessageQueue()

  return in_queue;  
public OutgoingMessageQueuegetOutgoingMessageQueue()

  return out_queue;  
public TransportgetTransport()

  return tcp_transport;  
public voidstartMessageProcessing()

	
    core_connection.startMessageProcessing();
    
    core_connection.enableEnhancedMessageProcessing( true );  //auto-upgrade connection