<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
		 xmlns:aop="http://www.springframework.net/aop"
         xmlns:db="http://www.springframework.net/database"
         xmlns:tx="http://www.springframework.net/tx">
    
    
    <!-- Property placeholder configurer for database settings -->

    <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
        <property name="ConfigSections" value="appSettings"/>
    </object>

    <!-- DB -->

    <db:provider id="dbProvider" provider="SqlServer-2.0" connectionString="${ConnectionString}"/>

    <object id="transactionManager" type="Spring.Data.Core.TxScopeTransactionManager, Spring.Data">

    </object>
    
    <!-- And actual Quartz -->
    
    <object id="quartzSchedulerFactory" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz">
        <property name="AutoStartup" value="true" />
        <property name="StartupDelay" value="5s" />
        <property name="QuartzProperties">
            <dictionary>
                <entry key="quartz.threadPool.threadCount" value="10"/>
                <entry key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
                <entry key="quartz.threadPool.threadPriority" value="Normal"/>
                <entry key="quartz.jobStore.misfireThreshold" value="60000"/>
                <entry key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"/>
                <entry key="quartz.jobStore.useProperties" value="false"/>
                <entry key="quartz.jobStore.tablePrefix" value="QRTZ_"/>
                <entry key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"/>
                
            </dictionary>
        </property>
        <property name="triggers">
            <list>
                <ref object="simpleTrigger" />
            </list>
        </property>
        <property name="DbProvider" ref="dbProvider" />
        <property name="TransactionManager" ref="transactionManager" />
    </object>

    <object id="testJob" type="Spring.Scheduling.Quartz.JobDetailObject, Spring.Scheduling.Quartz">
        <property name="JobType" value="Spring.Scheduling.Quartz.Integration.Tests.TestJob, Spring.Scheduling.Quartz.Integration.Tests" />
    </object>

    <object id="simpleTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz">
        <!-- see the example of method invoking job above -->
        <property name="jobDetail" ref="testJob" />
        <!-- 2 seconds -->
        <property name="startDelay" value="2s" />
        <!-- repeat every 3 seconds -->
        <property name="repeatInterval" value="3s" />
    </object>


</objects>
