org.kuali.rice.core.framework.config.module
Class ModuleConfigurer

java.lang.Object
  extended by org.kuali.rice.core.api.lifecycle.BaseLifecycle
      extended by org.kuali.rice.core.api.lifecycle.BaseCompositeLifecycle
          extended by org.kuali.rice.core.framework.config.module.ModuleConfigurer
All Implemented Interfaces:
Configurer, Lifecycle, org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware
Direct Known Subclasses:
CoreConfigurer, CoreServiceConfigurer, EDLConfigurer, KENConfigurer, KEWConfigurer, KIMConfigurer, KRADConfigurer, KRMSConfigurer, KSBConfigurer, LocationConfigurer

public class ModuleConfigurer
extends BaseCompositeLifecycle
implements Configurer, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.web.context.ServletContextAware


Field Summary
protected  org.apache.log4j.Logger LOG
           
 
Constructor Summary
ModuleConfigurer()
           
ModuleConfigurer(String moduleName)
           
 
Method Summary
protected  void addAdditonalToConfig()
           
 void addToConfig()
          This method does the following: Places all module specific configurations into the root config Adds any additional properties passed into the config into the root config Adds any items a subclass wants to put into the config
 void afterPropertiesSet()
           
 void destroy()
           
protected  void doAdditionalModuleStartLogic()
           
protected  void doAdditionalModuleStopLogic()
           
protected  void doAdditonalConfigurerValidations()
           
 List<String> getAdditionalSpringFiles()
           
protected  String getDefaultConfigPackagePath()
           
protected  String getDefaultSpringBeansPath(String configPackagePath)
           
 String getModuleName()
           
 List<String> getPrimarySpringFiles()
           
 Properties getProperties()
           
protected  Collection<ResourceLoader> getResourceLoadersToRegister()
           
 RunMode getRunMode()
           
 List<RunMode> getValidRunModes()
           
 WebModuleConfiguration getWebModuleConfiguration()
           
 boolean hasWebInterface()
          Indicates whether or not this module has a web interface module.
 void initializeResourceLoaders()
           
 boolean isExposeServicesOnBus()
           
 List<Lifecycle> loadLifecycles()
           
protected  WebModuleConfiguration loadWebModule()
          Subclasses can override the default implementation of this method if they want to provide a custom implementation for loading the web module configuration.
protected  void setModuleName(String moduleName)
           
 void setProperties(Properties properties)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
protected  void setValidRunModes(List<RunMode> validRunModes)
           
 boolean shouldRenderWebInterface()
          This base implementation returns true when the module has a web interface and the runMode is "local".
 void start()
           
 void stop()
           
 void validateConfigurerState()
           
 
Methods inherited from class org.kuali.rice.core.api.lifecycle.BaseLifecycle
isStarted, setStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.api.lifecycle.Lifecycle
isStarted
 

Field Detail

LOG

protected final org.apache.log4j.Logger LOG
Constructor Detail

ModuleConfigurer

public ModuleConfigurer()

ModuleConfigurer

public ModuleConfigurer(String moduleName)
Method Detail

start

public final void start()
                 throws Exception
Specified by:
start in interface Lifecycle
Overrides:
start in class BaseCompositeLifecycle
Throws:
Exception

doAdditionalModuleStartLogic

protected void doAdditionalModuleStartLogic()
                                     throws Exception
Throws:
Exception

afterPropertiesSet

public final void afterPropertiesSet()
                              throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

stop

public final void stop()
                throws Exception
Specified by:
stop in interface Lifecycle
Overrides:
stop in class BaseCompositeLifecycle
Throws:
Exception

doAdditionalModuleStopLogic

protected void doAdditionalModuleStopLogic()
                                    throws Exception
Throws:
Exception

destroy

public final void destroy()
                   throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

loadLifecycles

public List<Lifecycle> loadLifecycles()
                               throws Exception
Specified by:
loadLifecycles in interface Configurer
Specified by:
loadLifecycles in class BaseCompositeLifecycle
Throws:
Exception

getRunMode

public RunMode getRunMode()

hasWebInterface

public boolean hasWebInterface()
Indicates whether or not this module has a web interface module. Default implementation returns false, but subclasses can override to return true if they have a web module that can be loaded.

Returns:
true if this module has a web interface, false otherwise

shouldRenderWebInterface

public boolean shouldRenderWebInterface()
This base implementation returns true when the module has a web interface and the runMode is "local".

Subclasses can override this method if there are different requirements for inclusion of the web UI for the module.

Returns:
true if the web interface for this module should be rendered, false otherwise

isExposeServicesOnBus

public boolean isExposeServicesOnBus()

getPrimarySpringFiles

public List<String> getPrimarySpringFiles()
Specified by:
getPrimarySpringFiles in interface Configurer

getWebModuleConfiguration

public final WebModuleConfiguration getWebModuleConfiguration()

loadWebModule

protected WebModuleConfiguration loadWebModule()
Subclasses can override the default implementation of this method if they want to provide a custom implementation for loading the web module configuration. This method will be called from #getWebModuleConfiguration when #hasWebInterface return true.

Returns:
the loaded web module configuration, this method should *never* return null.

getProperties

public Properties getProperties()

setProperties

public void setProperties(Properties properties)

getAdditionalSpringFiles

public List<String> getAdditionalSpringFiles()

getModuleName

public String getModuleName()

setModuleName

protected void setModuleName(String moduleName)

getDefaultConfigPackagePath

protected String getDefaultConfigPackagePath()

getDefaultSpringBeansPath

protected String getDefaultSpringBeansPath(String configPackagePath)

getValidRunModes

public List<RunMode> getValidRunModes()

setValidRunModes

protected void setValidRunModes(List<RunMode> validRunModes)

validateConfigurerState

public final void validateConfigurerState()
Specified by:
validateConfigurerState in interface Configurer

doAdditonalConfigurerValidations

protected void doAdditonalConfigurerValidations()

addToConfig

public final void addToConfig()
This method does the following:
  1. Places all module specific configurations into the root config
  2. Adds any additional properties passed into the config into the root config
  3. Adds any items a subclass wants to put into the config

Specified by:
addToConfig in interface Configurer

addAdditonalToConfig

protected void addAdditonalToConfig()

initializeResourceLoaders

public final void initializeResourceLoaders()
                                     throws Exception
Specified by:
initializeResourceLoaders in interface Configurer
Throws:
Exception

getResourceLoadersToRegister

protected Collection<ResourceLoader> getResourceLoadersToRegister()
                                                           throws Exception
Throws:
Exception

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.