Skip to content

Commit

Permalink
SAK-41756 Kernel SakaiContextLoader support for servlet 3.0+ (sakaipr…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored May 7, 2019
1 parent ed7e4d3 commit 08714cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,29 @@
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.ContextLoader;

import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.context.WebApplicationContext;

/**
* <p>
* 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.
* Sakai's extension to Spring's {@link ContextLoader} - adds the location of the ComponentManager shared AC,
* linking the local AC to it as parent, and loading localy hosted components into shared.
* </p>
*/
@NoArgsConstructor
@Slf4j
public class SakaiContextLoader extends ContextLoader
{
public static final String SPRING_CONTEXT_SUFFIX = "-context.xml";

/**
* {@inheritDoc}
*/
public SakaiContextLoader(WebApplicationContext context) {
super(context);
}

/**
* Allows loading/override of custom bean definitions from sakai.home
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,27 @@
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.impl.SakaiContextLoader;
import org.sakaiproject.component.impl.SpringCompMgr;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.web.context.WebApplicationContext;

/**
* <p>
* Sakai's extension to the Spring ContextLoaderListener - use our ContextLoader, and increment / decrement the child count of the ComponentManager on init / destroy.
* </p>
*/
@NoArgsConstructor
@Slf4j
public class SakaiContextLoaderListener extends SakaiContextLoader implements ServletContextListener
{
public SakaiContextLoaderListener(WebApplicationContext context) {
super(context);
}

/**
* Initialize the root web application context.
*/
Expand Down

0 comments on commit 08714cd

Please sign in to comment.