SK.gnome.dwarf.tcpip
Class UDPHandler

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.UDPHandler
All Implemented Interfaces:
java.lang.Runnable, Service, Stoppable
Direct Known Subclasses:
SyslogHandler, UDPDaytimeHandler, UDPDiscardHandler, UDPEchoHandler, UDPChargenHandler, UDPTimeHandler

public abstract class UDPHandler
extends Handler

Abstract service for handling client datagrams.

This class processes the client datagrams. It works in tight cooperation with the TCPIPServer and UDPListener objects.

In order to develop a real handler the abstract handle(DatagramPacket) method must be overriden in the subclasses.


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
UDPHandler(java.lang.String name)
          Creates a new UDPHandler.
 
Method Summary
protected abstract  void handle(java.net.DatagramPacket packet)
          Handles the datagram packet.
protected  void handle(java.lang.Object obj)
          Performs the handling operation.
 
Methods inherited from class SK.gnome.dwarf.thread.Handler
enableThread, init, 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

UDPHandler

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

Method Detail

handle

protected void handle(java.lang.Object obj)
Performs the handling operation.

This method simply casts the obj argument to the java.net.DatagramPacket type and invokes the protected handle(DatagramPacket) method.

Specified by:
handle in class Handler

handle

protected abstract void handle(java.net.DatagramPacket packet)
Handles the datagram packet.

An abstract method for processing the client datagrams. Must be overriden in order to implement a real handler. It is called directly from the handle(Object) method.



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