org.deegree_impl.enterprise
Class AbstractOGCServlet

java.lang.Object
  extended byHttpServlet
      extended byorg.deegree_impl.enterprise.AbstractOGCServlet
Direct Known Subclasses:
WCSServlet, WFSServlet, WMSServlet, WTSServlet

public abstract class AbstractOGCServlet
extends HttpServlet

Abstract servlet that serves as an OCC-compliant HTTP-frontend to any OGC-WebService (WFS, WMS, ...).

Version:
$Revision: 1.14 $ $Date: 2004/03/12 15:56:47 $
Author:
Markus Schneider
See Also:
Serialized Form

Nested Class Summary
protected  class AbstractOGCServlet.Reloader
          Inner class that is used to monitor the configuration file (capabilities-file).
 
Field Summary
protected  java.net.URL capabilitiesURL
           
 AbstractOGCServlet.Reloader reloader
           
 
Constructor Summary
AbstractOGCServlet()
           
 
Method Summary
 void destroy()
          Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
protected  void enableReloader()
          Enables reloading mechanism on configuration file changes.
protected  java.util.HashMap getParamMap(HttpServletRequest request)
          Returns HTTP-parameters of a HttpServletRequest as a HashMap object.
protected  void handleError(java.lang.Exception ex, HttpServletResponse response)
          handles fatal errors by creating a OGC exception XML and sending it back to the client
 void init(ServletConfig servletConfig)
          Called by the servlet container to indicate that the servlet is being placed into service.
protected abstract  void initService()
          Called when a reinitialization of the service is necessary, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reloader

public AbstractOGCServlet.Reloader reloader

capabilitiesURL

protected java.net.URL capabilitiesURL
Constructor Detail

AbstractOGCServlet

public AbstractOGCServlet()
Method Detail

init

public void init(ServletConfig servletConfig)
          throws ServletException
Called by the servlet container to indicate that the servlet is being placed into service. Sets the debug level according to the debug parameter defined in the ServletEngine's environment.

NOTE: Everything that gets called by this method should not use Debug.xxx () to produce messages, but 'getServletContext.log ()'.

Parameters:
servletConfig - servlet configuration
Throws:
ServletException - exception if something occurred that interferes with the servlet's normal operation

destroy

public void destroy()
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. Stops the Reloader Thread, if running.


getParamMap

protected java.util.HashMap getParamMap(HttpServletRequest request)
Returns HTTP-parameters of a HttpServletRequest as a HashMap object.

Parameters:
request - source of the data
Returns:
keys are parameter-names, values are parameter values

enableReloader

protected void enableReloader()
Enables reloading mechanism on configuration file changes. Runs as a separate Thread. The file that is monitored is specified by the init parameter "capabilities" in the servlet container. Monitor frequency can be adjusted by the parameter "updateFrequency".


initService

protected abstract void initService()
Called when a reinitialization of the service is necessary, e.g. the configuration file has been altered.


handleError

protected void handleError(java.lang.Exception ex,
                           HttpServletResponse response)
handles fatal errors by creating a OGC exception XML and sending it back to the client