Home >Java >javaTutorial >Examples of integration and calling of spring and quartz

Examples of integration and calling of spring and quartz

零下一度
零下一度Original
2017-06-25 10:39:291704browse

There will be regular tasks at work ~ learn it briefly.

Step 0:

If a worker wants to do his job well, he must first sharpen his tools. The first thing to do is to guide the package.

Configure package scanning in spring and import packages in pom

spring.xml:

pom.xml

1. Configure related attributes in spring-quartz.xml (the same location as spring.xml)

The header of xml may be different for everyone, you have to use this yourself Pay attention when.

#The quartz expression is written according to your own needs. I won’t list it here. The one here is once every second.

2. Configuration class under the Task package

We store the scheduled tasks in a package and name it task. Use spring’s automatic annotation service operation

3. Implement related methods in Service

The real method to operate is to implement it here. It’s up to you what you want to do~Choose a simple output here

4. Start the server, the effect is as shown

The above is the detailed content of Examples of integration and calling of spring and quartz. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why use Spring framework?Next article:Why use Spring framework?