Quartz and the update checker(关闭Quartz update checker)

转自:http://www.korri.net/blog/2011/9/7-quartz-and-the-update-checker.html

 

Every programmer has probably at some point used a timer to run a piece of code at some exact time or after some exact interval. If you've used java, you've probably heard about Quartz scheduler.

I've used Quartz in couple of my own projects, but I haven't followed the project recently. Today I decided to rewrite some of my old code and update Quartz to the latest version. Ealier I've used Quartz version 1.6.1 and today when I checked the current stable version is 2.0.2.

I update the quartz jar and refactored the old scheduler code. All in all, everything went quite easily, although at one point I had to look at the example source code to figure out how the new builders are used. Eventually the code compiled and the jobs fired as they should.

One really surprising thing is that TerraCotta has added and update checker feature to the library and it's turned on by default. The update checker contacts the TerraCotta servers and asks for the newest version of Quartz. If you're running an older version, the checker prints a message to the log. It's not obtrusive at all but it's still wholly unnecessary thing to do.

Fortunately the update checker can be turned of but it isn't as easy as it could be. You can add a

  1. -Dorg.terracotta.quartz.skipUpdateCheck=true

startup parameter or you can add

  1. org.terracotta.quartz.skipUpdateCheck=true

to quartz.properties file to disable the update checker. Though both of these methods are unusable in my case.

I don't want to add custom startup parameters and having only the update checker line in quartz.properties doesn't work since you're then missing the default settings. The only usable way disable the update checker was to add

  1. System.setProperty("org.terracotta.quartz.skipUpdateCheck","true");

call to the initialization code. This is basicly the same thing as adding the startup parameter, but this way you don't have to fiddle with application server startup parameters.

 

--end

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值