org.apache.struts.plugins
Class ModuleConfigVerifier

java.lang.Object
  extended by org.apache.struts.plugins.ModuleConfigVerifier
All Implemented Interfaces:
org.apache.struts.action.PlugIn

public class ModuleConfigVerifier
extends Object
implements org.apache.struts.action.PlugIn

Convenient implementation of PlugIn that performs as many verification tests on the information stored in the ModuleConfig for this module as is practical. Based on the setting of the fatal property (which defaults to true), the detection of any such errors will cause a ServletException to be thrown from the init method, which will ultimately cause the initialization of your Struts controller servlet to fail.

Since:
Struts 1.1
Version:
$Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $

Field Summary
protected  org.apache.struts.config.ModuleConfig config
          The ModuleConfig instance for our module.
protected  org.apache.struts.action.ActionServlet servlet
          The ActionServlet instance we are associated with.
 
Constructor Summary
ModuleConfigVerifier()
           
 
Method Summary
 void destroy()
          Receive notification that our owning module is being shut down.
 void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig config)
           
 boolean isFatal()
          Return the "configuation errors are fatal" flag.
 void setFatal(boolean fatal)
          Set the "configuration errors are fatal" flag.
protected  boolean verifyActionMappingClass()
          Return true if information returned by config.getActionMappingClass is all valid; otherwise, log error messages and return false.
protected  boolean verifyForwardConfigs()
          Return true if information returned by config.findForwardConfigs is all valid; otherwise, log error messages and return false.
protected  boolean verifyMessageResourcesConfigs()
          Return true if information returned by config.findMessageResourcesConfigs is all valid; otherwise, log error messages and return false.
protected  boolean verifyPlugInConfigs()
          Return true if information returned by config.findPluginConfigs is all valid; otherwise, log error messages and return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.apache.struts.config.ModuleConfig config

The ModuleConfig instance for our module.


servlet

protected org.apache.struts.action.ActionServlet servlet

The ActionServlet instance we are associated with.

Constructor Detail

ModuleConfigVerifier

public ModuleConfigVerifier()
Method Detail

isFatal

public boolean isFatal()

Return the "configuation errors are fatal" flag.


setFatal

public void setFatal(boolean fatal)

Set the "configuration errors are fatal" flag.

Parameters:
fatal - The new flag value

destroy

public void destroy()

Receive notification that our owning module is being shut down.

Specified by:
destroy in interface org.apache.struts.action.PlugIn

init

public void init(org.apache.struts.action.ActionServlet servlet,
                 org.apache.struts.config.ModuleConfig config)
          throws ServletException
Specified by:
init in interface org.apache.struts.action.PlugIn
Throws:
ServletException

verifyActionMappingClass

protected boolean verifyActionMappingClass()

Return true if information returned by config.getActionMappingClass is all valid; otherwise, log error messages and return false.


verifyForwardConfigs

protected boolean verifyForwardConfigs()

Return true if information returned by config.findForwardConfigs is all valid; otherwise, log error messages and return false.


verifyMessageResourcesConfigs

protected boolean verifyMessageResourcesConfigs()

Return true if information returned by config.findMessageResourcesConfigs is all valid; otherwise, log error messages and return false.


verifyPlugInConfigs

protected boolean verifyPlugInConfigs()

Return true if information returned by config.findPluginConfigs is all valid; otherwise, log error messages and return false.



Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.