Announcement Announcement Module
Collapse
No announcement yet.
Simple Trigger (Quartz in spring) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Trigger (Quartz in spring)

    Hello friends !

    This is My ApplicationContext.xml for Job scheduling.....


    <!-- Start: JobDetailBean def -->

    <bean id="jobDetailBean" class="org.springframework.scheduling.quartz.JobDe tailBean">
    <property name="jobClass">
    <value>quartz.MyJob</value>
    </property>
    <property name="jobDataAsMap">
    <map>
    <entry key="messase"><ref bean="hello message" /></entry>
    </map>
    </property>
    </bean>

    <!-- end: JobDetailBean def -->

    <!-- Start :Triggers def -->
    <bean id="simpleTriggerBean" class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
    <property name="jobDetail">
    <ref local="jobDetailBean"/>
    </property>
    <property name="startDelay">
    <value>1000</value>
    </property>
    <property name="repeatInterval">
    <value>3000</value>
    </property>
    </bean>

    <!-- End :Triggers def -->

    <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
    <property name="triggers">
    <list>
    <ref local="simpleTriggerBean"/>
    </list>
    </property>
    </bean>
    </beans>

    My Query is that if i don't what to repeat my JOb Schedule using simple trigger than what what changes i have to make in my context.xml file.

    plz reply me ASP
    thanx

  • #2
    Please update the bean definition as follows.

    <bean id="simpleTriggerBean" class="org.springframework.scheduling.quartz.Simpl eTriggerBean">
    <property name="jobDetail">
    <ref local="jobDetailBean"/>
    </property>
    <property name="startDelay">
    <value>1000</value>
    </property>
    <property name="repeatInterval">
    <value>3000</value>
    </property>
    <property name="repeatCount">
    <value>1</value>
    </property>

    </bean>

    I hope this helps.


    Regards,
    Deepak

    Comment


    • #3
      simple trigger

      thank u frnd !


      I resolve this problem by applying following changes;

      Code:
      <bean id="simpleTriggerBean"
      		class="org.springframework.scheduling.quartz.SimpleTriggerBean"
      		lazy-init="true">
      		<property name="jobDetail" ref="jobDetailBean"></property>
      		<property name="repeatCount">
      			<value>0</value>
      		</property>
      		<property name="repeatInterval">
      			<value>6000</value>
      		</property>
      	</bean>
      again thanx for your reply

      Comment

      Working...
      X