LimeWire Consolidated API

org.limewire.net
Interface ConnectionDispatcher

All Known Implementing Classes:
ConnectionDispatcherImpl

public interface ConnectionDispatcher

Defines the requirements for classes that forward incoming connections to ConnectionAcceptors.


Method Summary
 void addConnectionAcceptor(ConnectionAcceptor acceptor, boolean localOnly, String... words)
          Associates the given SocketAcceptor with the given words.
 void dispatch(String word, Socket client, boolean newThread)
          Dispatches this incoming connection to the appropriate manager, depending on the word that was read.
 int getMaximumWordSize()
          Retrieves the maximum size a word can have.
 boolean isValidProtocolWord(String word)
          Determines if the word is valid for the understood protocols.
 void removeConnectionAcceptor(String... words)
          Removes any ConnectionAcceptors from being associated with the given words.
 

Method Detail

getMaximumWordSize

int getMaximumWordSize()
Retrieves the maximum size a word can have.


addConnectionAcceptor

void addConnectionAcceptor(ConnectionAcceptor acceptor,
                           boolean localOnly,
                           String... words)
Associates the given SocketAcceptor with the given words. If localOnly is true, non-local-host sockets will be closed when using the word. Otherwise, localhost sockets will be forbidden from using the word. If blocking is true, a new thread will be spawned when calling acceptor.acceptConnection.

Parameters:
acceptor - The SocketAcceptor to call acceptConnection on
localOnly - True if localhost connections are required, false if none allowed
words - The list of words to associate with this SocketAcceptor

removeConnectionAcceptor

void removeConnectionAcceptor(String... words)
Removes any ConnectionAcceptors from being associated with the given words.


isValidProtocolWord

boolean isValidProtocolWord(String word)
Determines if the word is valid for the understood protocols.


dispatch

void dispatch(String word,
              Socket client,
              boolean newThread)
Dispatches this incoming connection to the appropriate manager, depending on the word that was read.

Parameters:
word - The word associated with this Socket
client - Socket to use for dispatch
newThread - whether or not a new thread is necessary when dispatching to a blocking protocol.

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.