Holger's
Java API

com.antelmann.net
Class NetConnectionServer.DefaultDispatcher

java.lang.Object
  extended by com.antelmann.net.NetConnectionServer.DefaultDispatcher
All Implemented Interfaces:
ConnectionDispatcher
Enclosing class:
NetConnectionServer

public static class NetConnectionServer.DefaultDispatcher
extends Object
implements ConnectionDispatcher

The DefaultDispatcher provides a default ConnectionDispatcher that is used when the NetConnectionServer constructor in the enclosing class is called with a NetConnectionHandler


Constructor Summary
NetConnectionServer.DefaultDispatcher(NetConnectionHandler handler, Handshake handshake)
           
 
Method Summary
 NetConnection createConnection(Socket socket)
          simply returns SocketConnection.createServerConnection(socket, handshake)
 NetConnectionHandler createHandler(NetConnection con)
          uses the same handler (given in the constructor) for all connections
 Handshake getHandshake()
          returns the Handshake given in the constructor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetConnectionServer.DefaultDispatcher

public NetConnectionServer.DefaultDispatcher(NetConnectionHandler handler,
                                             Handshake handshake)
Method Detail

createConnection

public NetConnection createConnection(Socket socket)
                               throws IOException
simply returns SocketConnection.createServerConnection(socket, handshake)

Specified by:
createConnection in interface ConnectionDispatcher
Throws:
IOException
See Also:
SocketConnection.createServerConnection(Socket, Handshake)

createHandler

public NetConnectionHandler createHandler(NetConnection con)
uses the same handler (given in the constructor) for all connections

Specified by:
createHandler in interface ConnectionDispatcher
See Also:
MessageDelegator

getHandshake

public Handshake getHandshake()
returns the Handshake given in the constructor

Specified by:
getHandshake in interface ConnectionDispatcher


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