Http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
Add this in the configuration file
<!--Task Task Scan annotations-- <task:annotation-driven/><context:component-scan base-package= "com.******* . Tog.*.time "></context:component-scan>
Be sure to let Spring scan this package
@Scheduled (cron= "${timing.synchronous}")//Daily 2 o'clock in the morning ----get the time from the properties to be timed
public void Taskcycle () {Logger.debug ("Hint: timingswitch=" + timingswitch); if (timingswitch! = null && Timingswitch.equals ("no")) {---------The following is the server configured from the configuration needs that server synchronization logger.debug ("Tip: Do not synchronize data, if you want to synchronize, the AP The Timing.switch in P-config.properties is set to Yes "); return;} else if (timingswitch! = null && timingswitch.equals ("yes")) {}else{logger.debug ("hint: parameter timing. Switch is out of range and allows only [yes/no]!]; return;}
The timing method is very simple and very useful.
SPRINGMVC Self-timer, super easy to use, based on annotations