<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
                                                  
    <bean id="org.sakaiproject.api.app.scheduler.SchedulerManager"
        class="org.sakaiproject.component.app.scheduler.SchedulerManagerImpl"
        init-method="init" destroy-method="destroy">        
        <property name="qrtzJobs">
            <set>                
                <value>org.sakaiproject.component.app.scheduler.jobs.TestJob</value>
                <value>org.sakaiproject.component.app.scheduler.jobs.TestJob2</value>
            </set>
        </property>
        <property name="qrtzPropFile">
            <value>quartz.properties</value>
        </property>    
        <property name="globalTriggerListener">
            <bean class="org.sakaiproject.component.app.scheduler.GlobalTriggerListener"/>
        </property> 
        <property name="dataSource">
          <ref bean="javax.sql.DataSource"/>    
        </property>
        <property name="serverId">
            <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
                <property name="targetObject"><ref bean="org.sakaiproject.component.api.ServerConfigurationService"/></property>
                <property name="targetMethod"><value>getString</value></property>
                <property name="arguments">
                    <list>
                        <value>serverId</value>
                    </list>
                </property>
            </bean>
        </property>
        <property name="autoDdl">
          <value>${auto.ddl}</value>
        </property>
    </bean>

   <!-- sample bean job... this sample shows how to install a bean into quartz for scheduling -->

   <!-- this is the actual bean to execute.  This will have all
   spring injected values intact when executed -->
   <bean id="schedulerSampleTest"
      class="org.sakaiproject.component.app.scheduler.jobs.TestBeanJob">
      <property name="configMessage">
         <value>Hello from spring and quartz!</value>
      </property>
   </bean>

   <!-- this is the helper that will register the above bean with the schedule manager
        things to set here are the beanId (from bean above) and the jobName
   -->
   <bean id="org.sakaiproject.api.app.scheduler.JobBeanWrapper.schedulerSampleTest"
      class="org.sakaiproject.component.app.scheduler.jobs.SpringJobBeanWrapper"
      singleton="true" init-method="init">
      <property name="beanId">
         <value>schedulerSampleTest</value>
      </property>
      <property name="jobName">
         <value>Sample Bean Test</value>
      </property>
      <property name="schedulerManager">
         <ref bean="org.sakaiproject.api.app.scheduler.SchedulerManager" />
      </property>
   </bean>
   <!-- sample bean job -->
</beans>
