<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
    </sectionGroup>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
    </sectionGroup>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  </configSections>

  <common>
    <logging>
      <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1215">
        <!-- choices are INLINE, FILE, FILE-WATCH, EXTERNAL-->
        <!-- otherwise BasicConfigurer.Configure is used   -->
        <!-- log4net configuration file is specified with key configFile-->
        <arg key="configType" value="INLINE" />
      </factoryAdapter>
    </logging>
  </common>

  <spring>

    <context>
      <!-- using embedded assembly configuration file
      <resource uri="assembly://Spring.IocQuickStart.MovieFinder/Spring.IocQuickStart.MovieFinder/AppContext.xml"/>
      -->
      
      <!-- using section in App.config -->
      <resource uri="config://spring/objects"/>

    </context>

    <objects xmlns="http://www.springframework.net" >
      <description>An example that demonstrates simple IoC features.</description>

      <object id="MyMovieLister" 
              type="Spring.IocQuickStart.MovieFinder.MovieLister, Spring.IocQuickStart.MovieFinder">
        <property name="MovieFinder" ref="AnotherMovieFinder"/>
      </object>
      
      <!-- An IMovieFinder implementation that uses harcoded values as it's movie source... -->
      <object id="MyMovieFinder" 
              type="Spring.IocQuickStart.MovieFinder.SimpleMovieFinder, Spring.IocQuickStart.MovieFinder"/>
      
      <!-- An IMovieFinder implementation that uses a text file as it's movie source...     -->
      <object id="AnotherMovieFinder" 
              type="Spring.IocQuickStart.MovieFinder.ColonDelimitedMovieFinder, Spring.IocQuickStart.MovieFinder">
        <constructor-arg index="0" value="movies.txt"/>
      </object>

      <object type="Spring.Objects.Factory.Attributes.RequiredAttributeObjectPostProcessor, Spring.Core"/>
      
    </objects>

  </spring>

  <log4net>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-5level - %message%newline" />
      </layout>
    </appender>

    <!-- Set default logging level to DEBUG -->
    <root>
      <level value="DEBUG" />
      <appender-ref ref="ConsoleAppender" />
    </root>

    <!-- Set logging for MovieFinder to DEBUG -->
    <logger name="Spring.IocQuickStart.MovieFinder">
      <level value="DEBUG" />
    </logger>

    <!-- Set logging for Spring to INFO.  
         Logger names in Spring correspond to the namespace -->
    <logger name="Spring">
      <level value="INFO" />
    </logger>

  </log4net>

</configuration>
