org.iges.anagram.service
Class ErrorService

java.lang.Object
  |
  +--org.iges.anagram.AbstractModule
        |
        +--org.iges.anagram.service.Service
              |
              +--org.iges.anagram.service.ErrorService
All Implemented Interfaces:
Module
Direct Known Subclasses:
DODSErrorService, WebErrorService

public abstract class ErrorService
extends Service

A special type of service called when normal request processing produces an error.


Field Summary
 
Fields inherited from class org.iges.anagram.service.Service
enabled, moduleID, updateFormat
 
Fields inherited from class org.iges.anagram.AbstractModule
log, moduleName, parent, server
 
Constructor Summary
ErrorService()
           
 
Method Summary
 void handle(ClientRequest request)
          Not used by an error service
 void handle(ClientRequest request, ModuleException me)
          Handles "known" errors, i.e.
 void handleUnexpected(ClientRequest request, java.lang.Throwable t)
          Handles "unexpected" errors, i.e.
protected abstract  void sendErrorMsg(ClientRequest request, java.lang.String msg)
          Sends the message provided in a format defined by the ErrorService implementation.
protected abstract  void sendUnexpectedErrorMsg(ClientRequest request, java.lang.String debugInfo)
          Sends the "unexpected error" message provided in a format defined by the ErrorService implementation.
 
Methods inherited from class org.iges.anagram.service.Service
getBaseURL, getDataFromPath, getModuleID, getServiceName, isEnabled, printFooter, printHeader, setEnabled, startHTML
 
Methods inherited from class org.iges.anagram.AbstractModule
configModule, configure, debug, debug, error, fail, fail, fail, getModuleName, info, init, toString, verbose, verbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorService

public ErrorService()
Method Detail

handle

public void handle(ClientRequest request)
Not used by an error service

Specified by:
handle in class Service
Parameters:
request - The request to be handled

handle

public void handle(ClientRequest request,
                   ModuleException me)
Handles "known" errors, i.e. those which are intentionally generated by other Anagram modules. Calls the subclass's implementation of sendErrorMsg() to send an error message to the client, and logs the error


handleUnexpected

public void handleUnexpected(ClientRequest request,
                             java.lang.Throwable t)
Handles "unexpected" errors, i.e. those which result from runtime problems and coding errors. Calls the subclass's implementation of sendUnexpectedErrorMsg() to send an error message to the client, and logs the error


sendErrorMsg

protected abstract void sendErrorMsg(ClientRequest request,
                                     java.lang.String msg)
Sends the message provided in a format defined by the ErrorService implementation. Called by handle().


sendUnexpectedErrorMsg

protected abstract void sendUnexpectedErrorMsg(ClientRequest request,
                                               java.lang.String debugInfo)
Sends the "unexpected error" message provided in a format defined by the ErrorService implementation. Called by handle().