Holger's Java API

## com.antelmann.net
Interface ConnectionDispatcher

All Known Implementing Classes:
  ChatServer, JMessenger, NetConnectionServer.DefaultDispatcher

    public interface ConnectionDispatcher

used by a NetConnectionServer object to create a Thread that handles incoming connections

Author:
  Holger Antelmann
See Also:
  `NetConnectionServer`, `NetConnectionHandler`, `NetConnection`

Method Summary
`NetConnection` `createConnection(Socket socket)` produces a NetConnection based on the given socket.
`MessageDelegator` `createDispatcher(NetConnection con, NetConnectionHandler handler)` responsible for creating the delegator based on the created connection and the associated handler
`NetConnectionHandler` `createHandler(NetConnection con)` produces a NetConnectionHandler which will be started in a new Thread (created by the NetConnectionServer's ThreadFactory) to handle the given NetConnection and listens to messages.
`Handshake` `getHandshake()` returns a signature object used to identify the desired connection type handled by this ConnectionDispatcher object

Method Detail

### createConnection

    NetConnection createConnection(Socket socket)
                                   throws IOException

  produces a NetConnection based on the given socket.

  Throws:
    `IOException`
  See Also:
    `SocketConnection.createServerConnection(Socket, Handshake)`

### createHandler

    NetConnectionHandler createHandler(NetConnection con)

  produces a NetConnectionHandler which will be started in a new Thread (created by the NetConnectionServer's ThreadFactory) to handle the given NetConnection and listens to messages. Typically, the returned object could be a MessageDelegator.

  See Also:
    `MessageDelegator`

### createDispatcher

    MessageDelegator createDispatcher(NetConnection con,
                                      NetConnectionHandler handler)

  responsible for creating the delegator based on the created connection and the associated handler

### getHandshake

    Handshake getHandshake()

  returns a signature object used to identify the desired connection type handled by this ConnectionDispatcher object

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads