`
bruce008
  • 浏览: 174261 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Quarz 常用范式

 
阅读更多

Quaz  is a very common library for us to use to scheudle  regular jobs.  

Just record the paradism to use the Quarz 

1,  SchedulerFactory to initialize a scheduler to use, there might be several kinds of schedulers to use

     base on the property configuration, for example the thread pool size, the thread pool name

 

2, Once the scheduler is created, we can start the scheduler. Only the scheudler is started, we can use it. 

 

3, We can created a JobDetail with the Job class type to schedule a new Job with the crontrigger, which is used to specify the executing freqency of the Job.

       JobDetail  jobDetail = new JobDetail( jobName, jobGroupName, jobClassType);

                 JobDataMap is key/value map to specify the context, or the real parameter of the Job 

 

4,  We define the Job class type in the step 3.  It's better to define a StatefulJob for the Job , the execute method will be called back when a new Job triggered by the scheduler

      use the JobDataMap() to get the paramter to do the things.

 

5,  If we want to manage the scheduler life cycle , we can call its scheduler.stop 

 

There are quite a few defects we have faced in different version of quarz,  so we are using its stable version

1.6.5 .

 

  

 

 

 

分享到:
评论

相关推荐

    Springboot Mybaits MySql 等后端框架学习用.zip

    它集成了大量常用的第三方库配置,如JPA、MongoDB、RabbitMQ、Quartz等,只需少量配置即可运行。SpringBoot通过"约定优于配置"的原则,极大地提高了开发效率,降低了项目启动的门槛。 【MyBatis】 MyBatis是一个...

    springboot401学生选课系统--论文pf.zip

    在本项目中,SpringBoot作为核心开发框架,利用其轻量级、快速启动和集成了大量常用组件的特点,实现了系统的快速构建。下面将详细探讨此系统的关键技术和实现细节。 1. **SpringBoot框架应用** SpringBoot简化了...

    Java高手的25个学习要点.txt

    熟悉常用的日志框架如Log4J等,以及其他工具库如Quartz、JGroups等。 日志框架如Log4J可以帮助开发者记录应用程序运行过程中的关键信息,便于调试和监控。此外,还有许多其他有用的工具库,如Quartz(用于调度任务...

    2024 Spring学习文档全套

    2. **面向切面编程(Aspect-Oriented Programming, AOP)**:AOP是一种编程范式,它允许将横切关注点(如日志记录、事务管理等)从业务逻辑中分离出来,并以声明式的方式进行管理。Spring框架支持AOP编程,使得开发...

    史上最好传智播客就业班.net培训教程60G 不下会后悔

    常用数据结构(List、Dictionary、Array)、多态、常用设计模式、反射、常用.net类库、泛型、IO流、委托事件、正则表达式、XML、反射、GC等。 2、数据库开发及ADO.Net(6天) 核心技术课程 数据库开发基础、...

    JAVA:导师管理系统

    对于安排导师指导活动,可以使用Quartz或Spring Scheduler进行定时任务管理,自动化处理如提醒、统计分析等工作。 **日志记录** 日志记录对于系统监控和问题排查至关重要。Log4j或Logback是常用的Java日志框架,...

Global site tag (gtag.js) - Google Analytics