任务调度程序在Apache Felix中运行?

时间:2022-02-16 05:30:59

I want to implement a task scheduler to run in Apache Felix. The idea is the task scheduler will read a crontab file, and execute the task (the task is defined by a installed services or bundles) periodically. What is the best way to do this? I am new to OSGI, and good suggestions is appreciated.

我想实现一个任务调度程序在Apache Felix中运行。我们的想法是任务调度程序将读取crontab文件,并定期执行任务(任务由已安装的服务或捆绑包定义)。做这个的最好方式是什么?我是OSGI的新手,非常感谢好的建议。

1 个解决方案

#1


5  

Well, it's not really an OSGi matter (OSGi doesn't cover crontab-type event scheduling), I'd say use a 3rd party open source scheduler like Quartz:

好吧,它不是真正的OSGi问题(OSGi不包括crontab类型的事件调度),我会说使用像Quartz这样的第三方开源调度程序:

http://quartz-scheduler.org/

http://quartz-scheduler.org/

However, it's not an OSGi bundle out of the box, so that still might require some effort to make it work.

但是,它不是一个开箱即用的OSGi软件包,因此仍然可能需要一些努力才能使其工作。

Other suggestion: Apache Sling seems to have a built in scheduler (also based on Quartz), and as Sling is OSGi based, it should be reasonably easy to add to your app.

其他建议:Apache Sling似乎有一个内置的调度程序(也基于Quartz),而Sling是基于OSGi的,它应该相当容易添加到你的应用程序。

http://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html

http://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html

Hope this helps, Frank

弗兰克希望这有帮助

#1


5  

Well, it's not really an OSGi matter (OSGi doesn't cover crontab-type event scheduling), I'd say use a 3rd party open source scheduler like Quartz:

好吧,它不是真正的OSGi问题(OSGi不包括crontab类型的事件调度),我会说使用像Quartz这样的第三方开源调度程序:

http://quartz-scheduler.org/

http://quartz-scheduler.org/

However, it's not an OSGi bundle out of the box, so that still might require some effort to make it work.

但是,它不是一个开箱即用的OSGi软件包,因此仍然可能需要一些努力才能使其工作。

Other suggestion: Apache Sling seems to have a built in scheduler (also based on Quartz), and as Sling is OSGi based, it should be reasonably easy to add to your app.

其他建议:Apache Sling似乎有一个内置的调度程序(也基于Quartz),而Sling是基于OSGi的,它应该相当容易添加到你的应用程序。

http://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html

http://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html

Hope this helps, Frank

弗兰克希望这有帮助