Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Load root-beans.xml into the root context
iay committed May 12, 2018
1 parent bdbe4e7 commit 12cb879
Showing 3 changed files with 24 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
@@ -10,9 +10,11 @@ Built using:

## Spring Contexts

The root `ApplicationContext` in the application is the one provided by
Spring Boot. This is primarily configured using Java annotations, but
it would be possible to extend that with XML configuration if needed.
The root `ApplicationContext` in the application is the one provided by Spring
Boot. This is primarily configured using Java and annotations, but the
classpath resource `root-beans.xml` is also loaded into this context. This
provides some convenience when importing XML configuration from other uses of
the Shibboleth component framework.

The classpath resource `common-beans.xml` is used to configure a
`ClassPathXmlApplicationContext` which takes the root context as its
@@ -21,6 +21,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import uk.org.iay.incommon.validator.context.ValidatorCollection;
@@ -29,6 +30,7 @@
* Validator configuration.
*/
@Configuration
@ImportResource("root-beans.xml")
public class ValidatorConfiguration {

/** Class logger. */
17 changes: 17 additions & 0 deletions src/main/resources/root-beans.xml
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Additional bean definitions for the root context.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
default-lazy-init="true"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

</beans>

0 comments on commit 12cb879

Please sign in to comment.