Class ProcessingUnitContextLoader

java.lang.Object
org.springframework.web.context.ContextLoader
org.openspaces.pu.container.jee.context.ProcessingUnitContextLoader

public class ProcessingUnitContextLoader extends org.springframework.web.context.ContextLoader
Same as Spring ContextLoader. Different in two aspects:

The first, it automatillcay loads the binded META-INF/spring/pu.xml (binded into the servlet context) as the parent application context. See loadParentContext(jakarta.servlet.ServletContext).

Second, it overrides the creation of WebApplicationContext and automatically adds ClusterInfo and BeanLevelProperties handling. It also delegates the objects to the web context level Spring application context.

Author:
kimchy
  • Field Summary

    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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.web.context.WebApplicationContext
    createWebApplicationContext(jakarta.servlet.ServletContext servletContext, org.springframework.context.ApplicationContext parent)
    Creates a Spring WebApplicationContext - ProcessingUnitWebApplicationContext.
    org.springframework.web.context.WebApplicationContext
    initWebApplicationContext(jakarta.servlet.ServletContext servletContext)
     
    protected org.springframework.context.ApplicationContext
    loadParentContext(jakarta.servlet.ServletContext servletContext)
    Returns the application context bound under JeeProcessingUnitContainerProvider.APPLICATION_CONTEXT_CONTEXT within the servlet context.

    Methods inherited from class org.springframework.web.context.ContextLoader

    closeWebApplicationContext, configureAndRefreshWebApplicationContext, createWebApplicationContext, customizeContext, determineContextClass, determineContextInitializerClasses, getCurrentWebApplicationContext, setContextInitializers

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProcessingUnitContextLoader

      public ProcessingUnitContextLoader()
  • Method Details

    • initWebApplicationContext

      public org.springframework.web.context.WebApplicationContext initWebApplicationContext(jakarta.servlet.ServletContext servletContext) throws IllegalStateException, org.springframework.beans.BeansException
      Overrides:
      initWebApplicationContext in class org.springframework.web.context.ContextLoader
      Throws:
      IllegalStateException
      org.springframework.beans.BeansException
    • loadParentContext

      protected org.springframework.context.ApplicationContext loadParentContext(jakarta.servlet.ServletContext servletContext) throws org.springframework.beans.BeansException
      Returns the application context bound under JeeProcessingUnitContainerProvider.APPLICATION_CONTEXT_CONTEXT within the servlet context. This will act as the parent application context.
      Overrides:
      loadParentContext in class org.springframework.web.context.ContextLoader
      Throws:
      org.springframework.beans.BeansException
    • createWebApplicationContext

      protected org.springframework.web.context.WebApplicationContext createWebApplicationContext(jakarta.servlet.ServletContext servletContext, org.springframework.context.ApplicationContext parent) throws org.springframework.beans.BeansException
      Creates a Spring WebApplicationContext - ProcessingUnitWebApplicationContext.

      Adds support to ClusterInfo and BeanLevelProperties processors. The objects themself are bounded in the ServletContext.

      Throws:
      org.springframework.beans.BeansException