Search code examples
javaosgiapache-felix

task scheduler to run in Apache Felix?


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.


Solution

  • 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:

    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.

    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.

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

    Hope this helps, Frank