org.gudy.azureus2.pluginsimpl.local.network
Class ConnectionImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.network.ConnectionImpl
All Implemented Interfaces:
Connection

public class ConnectionImpl
extends Object
implements Connection


Constructor Summary
ConnectionImpl(NetworkConnection core_connection, boolean incoming)
           
 
Method Summary
 void close()
          Close and shutdown this connection.
 void connect(ConnectionListener listener)
          Connect this connection's transport, i.e.
 NetworkConnection getCoreConnection()
           
 IncomingMessageQueue getIncomingMessageQueue()
          Get the connection's incoming message queue.
 OutgoingMessageQueue getOutgoingMessageQueue()
          Get the connection's outgoing message queue.
 String getString()
          descriptive text for the connection
 Transport getTransport()
          Returns the transport object for this connection.
 boolean isIncoming()
          Returns true if the connection represents an incoming connection.
 void startMessageProcessing()
          Begin processing incoming and outgoing message queues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionImpl

public ConnectionImpl(NetworkConnection core_connection,
                      boolean incoming)
Method Detail

connect

public void connect(ConnectionListener listener)
Description copied from interface: Connection
Connect this connection's transport, i.e. establish the peer connection. If this connection is already established (from an incoming connection for example), then this provides a mechanism to register the connection listener, in which case connectSuccess() will be called immediately.

Specified by:
connect in interface Connection
Parameters:
listener - notified on connect success or failure

close

public void close()
Description copied from interface: Connection
Close and shutdown this connection.

Specified by:
close in interface Connection

getOutgoingMessageQueue

public OutgoingMessageQueue getOutgoingMessageQueue()
Description copied from interface: Connection
Get the connection's outgoing message queue.

Specified by:
getOutgoingMessageQueue in interface Connection
Returns:
outbound message queue

getIncomingMessageQueue

public IncomingMessageQueue getIncomingMessageQueue()
Description copied from interface: Connection
Get the connection's incoming message queue.

Specified by:
getIncomingMessageQueue in interface Connection
Returns:
inbound message queue

startMessageProcessing

public void startMessageProcessing()
Description copied from interface: Connection
Begin processing incoming and outgoing message queues.

Specified by:
startMessageProcessing in interface Connection

getTransport

public Transport getTransport()
Description copied from interface: Connection
Returns the transport object for this connection.

Specified by:
getTransport in interface Connection

getCoreConnection

public NetworkConnection getCoreConnection()

isIncoming

public boolean isIncoming()
Description copied from interface: Connection
Returns true if the connection represents an incoming connection.

Specified by:
isIncoming in interface Connection

getString

public String getString()
Description copied from interface: Connection
descriptive text for the connection

Specified by:
getString in interface Connection
Returns: