karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zaerymoghaddam <zaerymoghad...@gmail.com>
Subject Having commands for scheduler module
Date Mon, 13 Jan 2014 22:02:03 GMT
Hi guys

There is a module in Karaf named scheduler. It's a simple scheduler
implemented using java.util.Timer, contains only 4 classes and registers a
TaskScheduler service manually. There is no dependency to this module in

Here is my questions:

1. Why this module registers its only service (TaskScheduler) manually in
Activator class (not using blueprint.xml like other modules) and the service
has no interface (just the implementation class)?

I Don't know whether this is intentional or not! If there is some reasons
behind this design, what are they and if it has been designed this way just
because its an old module, is it possible to refactor it and make it
consistent with other modules?  

2. Why there isn't any command to interact with scheduler?

The scheduler bundle have a ServiceListener which listens for any changes in
services and if a service class is an instance of Runnable (that means it's
a Thread), adds it to the list of task schedulers and tries to run it in
given time periods. So there is no way to stop a repetitive task other than
undeploying the service implementing it. Also it seems that it would be
reasonable to have an option to change the repeating pattern or pause it and
etc. I Think we can have a command module to implement these options and let
the user to have more control over the scheduler.

I've tried to implement such command and I like to know your ideas about
this topic before finalizing implementation.


View this message in context: http://karaf.922171.n3.nabble.com/Having-commands-for-scheduler-module-tp4030991.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

View raw message