QuickServer
v1.4.7

org.quickserver.net.server.impl
Class DefaultClientEventHandler

java.lang.Object
  extended byorg.quickserver.net.server.impl.DefaultClientEventHandler
All Implemented Interfaces:
ClientEventHandler

public class DefaultClientEventHandler
extends java.lang.Object
implements ClientEventHandler

Default ClientEventHandler implementation.

This implementation will try to provide a default ClientEventHandler implementation. If a ClientCommandHandler is known to have been set then this implementation will look for ClientEventHandler methods in that implementation and pass the corresponding call to that method. This was done to provide backward compatibility with v1.4.5 and prior version of ClientCommandHandler.

Since:
1.4.6
Author:
Akshathkumar Shetty

Constructor Summary
DefaultClientEventHandler()
           
 
Method Summary
 void closingConnection(ClientHandler handler)
          Method called when client connection is closed.
 void gotConnected(ClientHandler handler)
          Method called when there is a new client connects to the QuickServer.
 void lostConnection(ClientHandler handler)
          Method called when client connection is lost.
 void setClientCommandHandler(ClientCommandHandler handler)
          Sets ClientCommandHandler that should be examined to find any ClientEventHandler methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClientEventHandler

public DefaultClientEventHandler()
Method Detail

setClientCommandHandler

public void setClientCommandHandler(ClientCommandHandler handler)
Sets ClientCommandHandler that should be examined to find any ClientEventHandler methods


gotConnected

public void gotConnected(ClientHandler handler)
                  throws java.net.SocketTimeoutException,
                         java.io.IOException
Description copied from interface: ClientEventHandler
Method called when there is a new client connects to the QuickServer. Can be used to send welcome message to the client and logging.

Specified by:
gotConnected in interface ClientEventHandler
Throws:
java.io.IOException - if io error in socket
java.net.SocketTimeoutException - if socket times out

lostConnection

public void lostConnection(ClientHandler handler)
                    throws java.io.IOException
Description copied from interface: ClientEventHandler
Method called when client connection is lost. Don't write to the connection in this method. Its just information, to be used at the Server end. It can be caused due to network errors.

Specified by:
lostConnection in interface ClientEventHandler
Throws:
java.io.IOException - if io error in socket

closingConnection

public void closingConnection(ClientHandler handler)
                       throws java.io.IOException
Description copied from interface: ClientEventHandler
Method called when client connection is closed. Don't write to the connection in this method. Its just information, you can use to log time and ip of client closing connection.

Specified by:
closingConnection in interface ClientEventHandler
Throws:
java.io.IOException - if io error in socket

QuickServer
v1.4.7

Copyright © 2003-2006 QuickServer.org