我正在使用spring的ScheduledTimerTask安排一些任务来安排某些任务。
<bean id="someScheduler" class="com.example.scheduler.SomeScheduler">
</bean>
<bean id="anotherScheduler" class="com.example.scheduler.SomeScheduler">
</bean>
<bean id="someImport" class="org.springframework.scheduling.timer.ScheduledTimerTask">
<property name="timerTask" ref="someScheduler" />
</bean>
<bean id="anotherImport" class="org.springframework.scheduling.timer.ScheduledTimerTask">
<property name="timerTask" ref="anotherScheduler" />
</bean>
如何在执行someScheduler时确保anotherScheduler不会执行?