SK.gnome.dwarf.tcpip
Class NioTCPHandler

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.thread.ThreadService
          extended bySK.gnome.dwarf.thread.Handler
              extended bySK.gnome.dwarf.tcpip.NioTCPHandler
All Implemented Interfaces:
java.lang.Runnable, Service, Stoppable

public class NioTCPHandler
extends Handler

Non-blocking service for handling the client requests.


Field Summary
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadService
daemon, thread
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
NioTCPHandler(java.lang.String name)
          Creates a new NioTCPHandler.
 
Method Summary
protected  void handle(java.lang.Object obj)
          Handles the client request.
 void init(Server parent)
          Initializes the service.
 
Methods inherited from class SK.gnome.dwarf.thread.Handler
enableThread, loop, start
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadService
finish, run, setDaemon, shutdown, stop
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NioTCPHandler

public NioTCPHandler(java.lang.String name)
Creates a new NioTCPHandler.

Method Detail

init

public void init(Server parent)
          throws ServiceException
Description copied from class: Handler
Initializes the service.

It requires that the parent server is an instance of MultiThreadServer class.

Specified by:
init in interface Service
Overrides:
init in class Handler
Throws:
ServiceException

handle

protected void handle(java.lang.Object obj)
Description copied from class: Handler
Handles the client request.

The abstract method for processing the client requests. It must be overriden in order to implement a real handler. The client request is generally represented by the obj argument. Since it is an instance of the basic java.lang.Object class, it can represent an arbitrary client request.

Specified by:
handle in class Handler


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.