简体   繁体   中英

How to Set repeatInterval for 24 hours using SimpleTriggerFactoryBean using XML configuration

This is XML Configuration file

<bean id="orderDetailsJobMonitorRefreshTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
        <property name="jobDetail" ref="refreshOrderDetailsJobMonitorSchedular"/>
        <property name="startDelay" value="70000"/>
        <property name="repeatInterval" value="200000"/>//How to Set for 24 hours using simple way
</bean>

From the Quartz doc , repeatInterval is the milliseconds. You could use SpEL to call the following static method on java.time.Duration to convert a 24 hour to milliseconds:

Duration.ofHours(24).toMillis();

In XML, it is equivalent to :

<property name="repeatInterval" value="#{T(java.time.Duration).ofHours(24).toMillis()}"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM