<?xml version="1.0"?>
<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>
    </configSections>

    <common>
        <logging>
            <factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging">
                <arg key="level" value="ALL"/>
            </factoryAdapter>
        </logging>
    </common>

    <spring>
        <context>
            <resource uri="Config/services.xml"/>
            <resource uri="config://spring/objects"/>
        </context>

        <objects xmlns="http://www.springframework.net">

            <description>Contains definitions how to export objects defined in ~/Config/services.xml</description>

            <!-- Define the component for exporting 'calculatorService' -->
            <object id="calculatorComponent" type="Spring.EnterpriseServices.ServicedComponentExporter, Spring.Services">
                <property name="TargetName" value="calculatorService"/>
                <property name="TypeAttributes">
                    <list>
                        <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices"/>
                    </list>
                </property>
                <property name="MemberAttributes">
                    <dictionary>
                        <entry key="*">
                            <list>
                                <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices"/>
                            </list>
                        </entry>
                    </dictionary>
                </property>
            </object>

            <!-- Define the component for exporting 'simpleCalculatorService' -->
            <object id="simpleCalculatorComponent" type="Spring.EnterpriseServices.ServicedComponentExporter, Spring.Services">
                <property name="TargetName" value="simpleCalculatorService"/>
            </object>

            <!-- Export components into assembly and autoregister with COM+ -->
            <object type="Spring.EnterpriseServices.EnterpriseServicesExporter, Spring.Services">
                
                <!-- assembly name to generate - will generate 'Spring.Calculator.EnterpriseServices.dll'  -->
                <property name="Assembly" value="Spring.Calculator.EnterpriseServices"/>
                
                <!-- 
                use Spring's ContextRegistry for managing services. If true, requires a file  
                'Spring.Calculator.EnterpriseServices.dll.config' (for 'Library')
                'Spring.Calculator.EnterpriseServices.exe.config' (for 'Server')                
                containing a <spring/context /> section placed next to the generated assembly.
                -->
                <property name="UseSpring" value="true"/>
                <property name="ApplicationName" value="Spring Calculator Application"/>
                <!--<property name="ActivationMode" value="Library" />-->
                <property name="ActivationMode" value="Server"/>
                <property name="Description" value="Spring Calculator application"/>
                <property name="Components">
                    <list>
                        <ref object="calculatorComponent"/>
                        <ref object="simpleCalculatorComponent"/>
                    </list>
                </property>
                <property name="AccessControl">
                    <object type="System.EnterpriseServices.ApplicationAccessControlAttribute, System.EnterpriseServices">
                        <property name="Value">
                            <value>false</value>
                        </property>
                    </object>
                </property>
                <!--
                <property name="AccessControl">
	                <object type="System.EnterpriseServices.ApplicationAccessControlAttribute, System.EnterpriseServices">
		                <property name="Value">
			                <value>true</value>
		                </property>
		                <property name="AccessChecksLevel">
			                <value>ApplicationComponent</value>
		                </property>
	                </object>
                </property>
                <property name="Roles">
	                <list>
		                <value>Admin : Administrator role</value>
		                <value>User : User role</value>
		                <value>Manager : Administrator role</value>
	                </list>
                </property>
                -->
            </object>

        </objects>
    </spring>
  
</configuration>
