Class SakaiContextLoader

  • Direct Known Subclasses:
    SakaiContextLoaderListener

    public class SakaiContextLoader
    extends org.springframework.web.context.ContextLoader

    Sakai's extension to Spring's ContextLoader - adds the location of the ComponentManager shared AC, linking the local AC to it as parent, and loading localy hosted components into shared.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String SPRING_CONTEXT_SUFFIX  
      • Fields inherited from class org.springframework.web.context.ContextLoader

        CONFIG_LOCATION_PARAM, CONTEXT_CLASS_PARAM, CONTEXT_ID_PARAM, CONTEXT_INITIALIZER_CLASSES_PARAM, GLOBAL_INITIALIZER_CLASSES_PARAM
    • Constructor Summary

      Constructors 
      Constructor Description
      SakaiContextLoader​(org.springframework.web.context.WebApplicationContext context)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void customizeContext​(javax.servlet.ServletContext sc, org.springframework.web.context.ConfigurableWebApplicationContext wac)
      Allows loading/override of custom bean definitions from sakai.home
      protected org.springframework.context.ApplicationContext loadParentContext​(javax.servlet.ServletContext servletContext)
      Spring allows a parent ApplicationContext to be set during the creation of a new ApplicationContext Sakai sets the SakaiApplicationContext as the parent which managed by the ComponentManager
      • Methods inherited from class org.springframework.web.context.ContextLoader

        closeWebApplicationContext, configureAndRefreshWebApplicationContext, createWebApplicationContext, determineContextClass, determineContextInitializerClasses, getCurrentWebApplicationContext, initWebApplicationContext, setContextInitializers
    • Constructor Detail

      • SakaiContextLoader

        public SakaiContextLoader​(org.springframework.web.context.WebApplicationContext context)
    • Method Detail

      • customizeContext

        protected void customizeContext​(javax.servlet.ServletContext sc,
                                        org.springframework.web.context.ConfigurableWebApplicationContext wac)
        Allows loading/override of custom bean definitions from sakai.home

        The pattern is the 'servlet_name-context.xml'

        Overrides:
        customizeContext in class org.springframework.web.context.ContextLoader
        Parameters:
        sc - current servlet context
        wac - the new WebApplicationContext
      • loadParentContext

        protected org.springframework.context.ApplicationContext loadParentContext​(javax.servlet.ServletContext servletContext)
                                                                            throws org.springframework.beans.BeansException
        Spring allows a parent ApplicationContext to be set during the creation of a new ApplicationContext Sakai sets the SakaiApplicationContext as the parent which managed by the ComponentManager
        Overrides:
        loadParentContext in class org.springframework.web.context.ContextLoader
        Parameters:
        servletContext - (not used)
        Returns:
        the shared SakaiApplicationContext
        Throws:
        org.springframework.beans.BeansException