protected synchronized ModuleConfig registerModule ( String modulePath , String configFilePath ) throws ServletException { if ( _log . isInfoEnabled ( ) ) { _log . info ( "Dynamically registering module " + modulePath + ", config XML " + configFilePath ) ; } if ( _log . isInfoEnabled ( ) ) { InternalStringBuilder msg = new InternalStringBuilder ( "Dynamically registering module " ) . append ( modulePath ) ; _log . info ( msg . append ( ", config XML " ) . append ( configFilePath ) . toString ( ) ) ; } if ( _cachedConfigDigester == null ) { _cachedConfigDigester = initConfigDigester ( ) ; } configDigester = _cachedConfigDigester ; ModuleConfig ac = initModuleConfig ( modulePath , configFilePath ) ; initModuleMessageResources ( ac ) ; initModuleDataSources ( ac ) ; initModulePlugIns ( ac ) ; ac . freeze ( ) ; configDigester = null ; // If this is a FlowController module, make a callback to the event reporter. ControllerConfig cc = ac . getControllerConfig ( ) ; if ( cc instanceof PageFlowControllerConfig ) { PageFlowControllerConfig pfcc = ( PageFlowControllerConfig ) cc ; PageFlowEventReporter er = AdapterManager . getServletContainerAdapter ( getServletContext ( ) ) . getEventReporter ( ) ; er . flowControllerRegistered ( modulePath , pfcc . getControllerClass ( ) , ac ) ; } // Initialize any delegating action configs or exception handler configs. InternalUtils . initDelegatingConfigs ( ac , getServletContext ( ) ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Finished registering module " + modulePath + ", config XML " + configFilePath ) ; } return ac ; }
Register a Struts module initialized by the given configuration file .