You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Ioannis Canellos <io...@gmail.com> on 2011/07/20 14:38:18 UTC
Introducing a task scheduler in Karaf
Hi,
I added a new module to Karaf. The purpose of this module is to provide
means for scheduling tasks through the osgi service registry.
The scheduler module registers a ServiceListener that listens for services
of the java.lang.Runnable interface that also have 2 service properties that
are required for scheduling:
a) org.apache.karaf.scheduler.task.id (A string identifier for the task that
is going to be scheduled).
b) org.apache.karaf.scheduler.task.period (A long number that indicates the
execution period in milliseconds).
Please note that all Runnable that don't have both properties will be
ignored. All other will be scheduled for execution via java Timer.
I also plan to add shell commands for listing, rescheduling
& canceling events. It might be a goog idea to also add properties for
supporting cron expression etc.
You can find the initial commit in the trunk.
wdyt?
--
*Ioannis Canellos*
*
http://iocanel.blogspot.com
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
Yes, I was thinking something like this.
--
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>
**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/> Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by "Jamie G." <ja...@gmail.com>.
Rescheduling it for 3.1.0 would be acceptable.
As to removing the code from trunk, would it make the most sense to
temporally retreat it, then bring it back into the 3.1.0 branch once
created?
Jamie
On Wed, Dec 7, 2011 at 11:25 AM, Ioannis Canellos <io...@gmail.com> wrote:
> As we are marching towards 3.0.0 release and we haven't done anything about
> it (its still in primitive state) maybe its a good idea to remove it from
> trunk and maybe put it in the sandbox or something.
>
> What do you think?
>
> --
> *Ioannis Canellos*
> *
> FuseSource <http://fusesource.com>
>
> **
> Blog: http://iocanel.blogspot.com
> **
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache Camel <http://camel.apache.org/> Committer
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> Apache Gora <http://incubator.apache.org/gora/> Committer
> Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
> *
Re: Introducing a task scheduler in Karaf
Posted by Andreas Pieber <an...@gmail.com>.
I second JB on that. I've given it a short look a while ago and although it
isn't completed I don't consider it harmful. Removing it and adding it
sounds like too much work for a feature which doesn't harm to me :-)
Kind regards,
Andreas
On Wed, Dec 7, 2011 at 16:01, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi Ioannis,
>
> I think that we can let as it is in Karaf 3.0, but not
> advertising/blogging/**documentating it.
>
> We can plan a refactoring in Karaf 3.1.0, this time with "communication"
> to the users.
>
> WDYT ?
>
> Regards
> JB
>
>
> On 12/07/2011 03:55 PM, Ioannis Canellos wrote:
>
>> As we are marching towards 3.0.0 release and we haven't done anything
>> about
>> it (its still in primitive state) maybe its a good idea to remove it from
>> trunk and maybe put it in the sandbox or something.
>>
>> What do you think?
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
Re: Introducing a task scheduler in Karaf
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ioannis,
I think that we can let as it is in Karaf 3.0, but not
advertising/blogging/documentating it.
We can plan a refactoring in Karaf 3.1.0, this time with "communication"
to the users.
WDYT ?
Regards
JB
On 12/07/2011 03:55 PM, Ioannis Canellos wrote:
> As we are marching towards 3.0.0 release and we haven't done anything about
> it (its still in primitive state) maybe its a good idea to remove it from
> trunk and maybe put it in the sandbox or something.
>
> What do you think?
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
As we are marching towards 3.0.0 release and we haven't done anything about
it (its still in primitive state) maybe its a good idea to remove it from
trunk and maybe put it in the sandbox or something.
What do you think?
--
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>
**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/> Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Guillaume Nodet <gn...@gmail.com>.
Ok.
What then I think a couple of commands on top of the sling service
would do the trick. The extender part can be added on top of that
too, but that's a different area imho.
On Mon, Jul 25, 2011 at 16:08, Ioannis Canellos <io...@gmail.com> wrote:
>>
>> I guess the part I'm still missing is the use cases for wrapping Timer
>> or ScheduledExecutorService. ;-)
>
>
> The way I see it it's not about wrapping, but its about managing.
>
> So some uses could be:
> a) List the scheduled/recurring tasks.
> b) Cancel a task.
> c) reschedule a task.
> d) pause/resume the execution of a task.
>
> On top of that, the fact that we can have a single shared thread pool that
> is going to be used to execute those tasks has value on its own.
>
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> Apache Gora <http://incubator.apache.org/gora/> Committer
> *
>
--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
>
> I guess the part I'm still missing is the use cases for wrapping Timer
> or ScheduledExecutorService. ;-)
The way I see it it's not about wrapping, but its about managing.
So some uses could be:
a) List the scheduled/recurring tasks.
b) Cancel a task.
c) reschedule a task.
d) pause/resume the execution of a task.
On top of that, the fact that we can have a single shared thread pool that
is going to be used to execute those tasks has value on its own.
--
*Ioannis Canellos*
*
http://iocanel.blogspot.com
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/> Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Guillaume Nodet <gn...@gmail.com>.
I completely agree that implementation without a use case is not
really the best way to go.
Forcing users to use an OSGi service registration to avoid calling the
JRE api does not seem worthwhile either. I guess the part I'm still
missing is the use cases for wrapping Timer or
ScheduledExecutorService. ;-)
On Mon, Jul 25, 2011 at 13:51, Andreas Pieber <an...@gmail.com> wrote:
> I'm not sure if it's really worth to use quartz here. Still I think we
> shouldn't start implementing things before there is actually a use case for
> it (at least I'm happy right now with the classical timer support :)).
> Quartz can also work with the new Java 6 scheduling interface --> we can
> upgrade later here (and stay fully backward compatible).
>
> In addition I think it may be nice to add some blueprint support similar to
> the spring timer support which can also work with quartz and the
> java6 scheduler. In addition it would be nice to have commands to start such
> services manually and to list all registered timers and the time till they
> will be executed next
>
> WDYT?
>
> Kind regards,
> Andreas
>
> On Thu, Jul 21, 2011 at 23:32, Ioannis Canellos <io...@gmail.com> wrote:
>
>> Do you think that it worths using quartz instead?
>>
>>
>> On Friday, July 22, 2011, Guillaume Nodet <gn...@gmail.com> wrote:
>> > Well, honestly, I'm not sure it's really worth the pain if the goal is
>> > simply to avoid using
>> > Executors.newSingleThreadScheduledExecutor().schedule(runnable,
>> > delay, TimeUnit.MILLISECONDS)
>> >
>> > If there's a need to manage recurrent tasks, we need to have a full
>> > featured engine for that and have a much better support for it.
>> >
>> > Just my $0.02
>> >
>> > On Thu, Jul 21, 2011 at 15:38, Ioannis Canellos <io...@gmail.com>
>> wrote:
>> >>>
>> >>>
>> >>> The JDK Timer is kinda @deprecated in favor of the
>> >>> ScheduledExecutorService in Java5+.
>> >>> The latter supports thread pooling.
>> >>
>> >>
>> >> Thanks Claus for bringing this up. For me this is enough. If you think
>> that
>> >> we should still use quartz to take advantage of features like
>> persistence,
>> >> clustering etc, let me know.
>> >>
>> >>
>> >> --
>> >> *Ioannis Canellos*
>> >> *
>> >> http://iocanel.blogspot.com
>> >>
>> >> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> >> Apache ServiceMix <http://servicemix.apache.org/> Committer
>> >> *
>> >>
>> >
>> >
>> >
>> > --
>> > ------------------------
>> > Guillaume Nodet
>> > ------------------------
>> > Blog: http://gnodet.blogspot.com/
>> > ------------------------
>> > Open Source SOA
>> > http://fusesource.com
>> >
>>
>> --
>> *Ioannis Canellos*
>> *
>> http://iocanel.blogspot.com
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> Apache ServiceMix <http://servicemix.apache.org/> Committer
>> *
>>
>
--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: Introducing a task scheduler in Karaf
Posted by Andreas Pieber <an...@gmail.com>.
I'm not sure if it's really worth to use quartz here. Still I think we
shouldn't start implementing things before there is actually a use case for
it (at least I'm happy right now with the classical timer support :)).
Quartz can also work with the new Java 6 scheduling interface --> we can
upgrade later here (and stay fully backward compatible).
In addition I think it may be nice to add some blueprint support similar to
the spring timer support which can also work with quartz and the
java6 scheduler. In addition it would be nice to have commands to start such
services manually and to list all registered timers and the time till they
will be executed next
WDYT?
Kind regards,
Andreas
On Thu, Jul 21, 2011 at 23:32, Ioannis Canellos <io...@gmail.com> wrote:
> Do you think that it worths using quartz instead?
>
>
> On Friday, July 22, 2011, Guillaume Nodet <gn...@gmail.com> wrote:
> > Well, honestly, I'm not sure it's really worth the pain if the goal is
> > simply to avoid using
> > Executors.newSingleThreadScheduledExecutor().schedule(runnable,
> > delay, TimeUnit.MILLISECONDS)
> >
> > If there's a need to manage recurrent tasks, we need to have a full
> > featured engine for that and have a much better support for it.
> >
> > Just my $0.02
> >
> > On Thu, Jul 21, 2011 at 15:38, Ioannis Canellos <io...@gmail.com>
> wrote:
> >>>
> >>>
> >>> The JDK Timer is kinda @deprecated in favor of the
> >>> ScheduledExecutorService in Java5+.
> >>> The latter supports thread pooling.
> >>
> >>
> >> Thanks Claus for bringing this up. For me this is enough. If you think
> that
> >> we should still use quartz to take advantage of features like
> persistence,
> >> clustering etc, let me know.
> >>
> >>
> >> --
> >> *Ioannis Canellos*
> >> *
> >> http://iocanel.blogspot.com
> >>
> >> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> >> Apache ServiceMix <http://servicemix.apache.org/> Committer
> >> *
> >>
> >
> >
> >
> > --
> > ------------------------
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > Open Source SOA
> > http://fusesource.com
> >
>
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> *
>
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
Do you think that it worths using quartz instead?
On Friday, July 22, 2011, Guillaume Nodet <gn...@gmail.com> wrote:
> Well, honestly, I'm not sure it's really worth the pain if the goal is
> simply to avoid using
> Executors.newSingleThreadScheduledExecutor().schedule(runnable,
> delay, TimeUnit.MILLISECONDS)
>
> If there's a need to manage recurrent tasks, we need to have a full
> featured engine for that and have a much better support for it.
>
> Just my $0.02
>
> On Thu, Jul 21, 2011 at 15:38, Ioannis Canellos <io...@gmail.com> wrote:
>>>
>>>
>>> The JDK Timer is kinda @deprecated in favor of the
>>> ScheduledExecutorService in Java5+.
>>> The latter supports thread pooling.
>>
>>
>> Thanks Claus for bringing this up. For me this is enough. If you think that
>> we should still use quartz to take advantage of features like persistence,
>> clustering etc, let me know.
>>
>>
>> --
>> *Ioannis Canellos*
>> *
>> http://iocanel.blogspot.com
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> Apache ServiceMix <http://servicemix.apache.org/> Committer
>> *
>>
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
--
*Ioannis Canellos*
*
http://iocanel.blogspot.com
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Guillaume Nodet <gn...@gmail.com>.
Well, honestly, I'm not sure it's really worth the pain if the goal is
simply to avoid using
Executors.newSingleThreadScheduledExecutor().schedule(runnable,
delay, TimeUnit.MILLISECONDS)
If there's a need to manage recurrent tasks, we need to have a full
featured engine for that and have a much better support for it.
Just my $0.02
On Thu, Jul 21, 2011 at 15:38, Ioannis Canellos <io...@gmail.com> wrote:
>>
>>
>> The JDK Timer is kinda @deprecated in favor of the
>> ScheduledExecutorService in Java5+.
>> The latter supports thread pooling.
>
>
> Thanks Claus for bringing this up. For me this is enough. If you think that
> we should still use quartz to take advantage of features like persistence,
> clustering etc, let me know.
>
>
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> *
>
--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
>
>
> The JDK Timer is kinda @deprecated in favor of the
> ScheduledExecutorService in Java5+.
> The latter supports thread pooling.
Thanks Claus for bringing this up. For me this is enough. If you think that
we should still use quartz to take advantage of features like persistence,
clustering etc, let me know.
--
*Ioannis Canellos*
*
http://iocanel.blogspot.com
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jul 20, 2011 at 4:00 PM, Ioannis Canellos <io...@gmail.com> wrote:
> I am glad that I see so much interest in it.
>
> It would make sense to use quartz instead of Java Timer mostly due to the
> fact that quartz supports thread pooling while timers don't. So, I think
> that it would be a good idea to replace Timers with Quartz.
>
The JDK Timer is kinda @deprecated in favor of the
ScheduledExecutorService in Java5+.
The latter supports thread pooling.
> @Glenn: No problem with peeping. We actually love feedback! What I have in
> mind is providing a simple / simplistic feature that will hide the details
> from the user (quartz api etc). I didn't intend to build a scheduler myself,
> I just intended to integrate a the service registry with
> a scheduling mechanism.
>
> @Mark: It would make sense to have a common mechanism. I will have a look at
> what sling provides.
>
>
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> *
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: Introducing a task scheduler in Karaf
Posted by Ioannis Canellos <io...@gmail.com>.
I am glad that I see so much interest in it.
It would make sense to use quartz instead of Java Timer mostly due to the
fact that quartz supports thread pooling while timers don't. So, I think
that it would be a good idea to replace Timers with Quartz.
@Glenn: No problem with peeping. We actually love feedback! What I have in
mind is providing a simple / simplistic feature that will hide the details
from the user (quartz api etc). I didn't intend to build a scheduler myself,
I just intended to integrate a the service registry with
a scheduling mechanism.
@Mark: It would make sense to have a common mechanism. I will have a look at
what sling provides.
--
*Ioannis Canellos*
*
http://iocanel.blogspot.com
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache ServiceMix <http://servicemix.apache.org/> Committer
*
Re: Introducing a task scheduler in Karaf
Posted by Charles Moulliard <cm...@gmail.com>.
Hi Ioannis,
This is an excellent idea and could be very helpful for pure java
project requiring scheduler like Quartz on Karaf platform. As
Camel/ActiveMQ already uses Quartz like plenty of Java projects, that
will be a very nice feature to deploy jobs on the platform.
Regards,
Charles Moulliard
Apache Committer
Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard
On Wed, Jul 20, 2011 at 2:38 PM, Ioannis Canellos <io...@gmail.com> wrote:
> Hi,
>
> I added a new module to Karaf. The purpose of this module is to provide
> means for scheduling tasks through the osgi service registry.
>
> The scheduler module registers a ServiceListener that listens for services
> of the java.lang.Runnable interface that also have 2 service properties that
> are required for scheduling:
>
> a) org.apache.karaf.scheduler.task.id (A string identifier for the task that
> is going to be scheduled).
> b) org.apache.karaf.scheduler.task.period (A long number that indicates the
> execution period in milliseconds).
>
> Please note that all Runnable that don't have both properties will be
> ignored. All other will be scheduled for execution via java Timer.
>
> I also plan to add shell commands for listing, rescheduling
> & canceling events. It might be a goog idea to also add properties for
> supporting cron expression etc.
>
> You can find the initial commit in the trunk.
>
> wdyt?
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> *
>
Re: Introducing a task scheduler in Karaf
Posted by Mark Derricutt <ma...@talios.com>.
I've not looked at it but I believe apache sling has a scheduling service
that wraps quartz already.
Would it worth while extracting that to a common service both karaf and
sling could share?
Mark
-- Sent from an Android.
On 21/07/2011 12:49 AM, "Jean-Baptiste Onofré" <jb...@nanthrax.net> wrote:
> Hi Ioannis,
>
> It's a really good idea (we discussed of that for Cellar :)).
>
> It could be very helpful for a large set of requirements.
>
> I wonder:
> 1/ should it be a standard feature or an optional one (I think standard
> is better as it doesn't require any resource if not used. It could be
> comparable to the Scheduler that we find in an Oracle database).
> 2/ as for security/encryption (which use a simple encryption class or
> Jasypt), maybe it could be interesting a use a simple scheduler (just a
> Java Timer) and provide an optional feature to provide advanced
> scheduling (cron, etc) which can be powered by Quartz
> 3/ add commands and console pages is a requirement. We can imagine
> projects that could use Karaf as an enterprise scheduler (with team
> escalation, etc).
>
> Thanks
> Regards
> JB
>
> On 07/20/2011 02:38 PM, Ioannis Canellos wrote:
>> Hi,
>>
>> I added a new module to Karaf. The purpose of this module is to provide
>> means for scheduling tasks through the osgi service registry.
>>
>> The scheduler module registers a ServiceListener that listens for
services
>> of the java.lang.Runnable interface that also have 2 service properties
that
>> are required for scheduling:
>>
>> a) org.apache.karaf.scheduler.task.id (A string identifier for the task
that
>> is going to be scheduled).
>> b) org.apache.karaf.scheduler.task.period (A long number that indicates
the
>> execution period in milliseconds).
>>
>> Please note that all Runnable that don't have both properties will be
>> ignored. All other will be scheduled for execution via java Timer.
>>
>> I also plan to add shell commands for listing, rescheduling
>> & canceling events. It might be a goog idea to also add properties for
>> supporting cron expression etc.
>>
>> You can find the initial commit in the trunk.
>>
>> wdyt?
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
Re: Introducing a task scheduler in Karaf
Posted by Glen Mazza <gm...@talend.com>.
Pardon me for piping in (I know just enough to be dangerous ;), but was
there any reinventing of the wheel in your commit, Ioannis, that could
be avoided by closer integration with the Quartz Scheduler (already
Apache-licensed and famous: http://www.quartz-scheduler.org/)--not just
the "advanced" stuff that JB is mentioning in #3 below? Using Quartz as
much as possible might also mean Karaf users can rely on Quartz'
documentation for scheduling instead of potentially needing to learn two
sets of scheduling rules.
Glen
On 07/20/2011 08:48 AM, Jean-Baptiste Onofré wrote:
> Hi Ioannis,
>
> It's a really good idea (we discussed of that for Cellar :)).
>
> It could be very helpful for a large set of requirements.
>
> I wonder:
> 1/ should it be a standard feature or an optional one (I think standard
> is better as it doesn't require any resource if not used. It could be
> comparable to the Scheduler that we find in an Oracle database).
> 2/ as for security/encryption (which use a simple encryption class or
> Jasypt), maybe it could be interesting a use a simple scheduler (just a
> Java Timer) and provide an optional feature to provide advanced
> scheduling (cron, etc) which can be powered by Quartz
> 3/ add commands and console pages is a requirement. We can imagine
> projects that could use Karaf as an enterprise scheduler (with team
> escalation, etc).
>
> Thanks
> Regards
> JB
>
> On 07/20/2011 02:38 PM, Ioannis Canellos wrote:
>> Hi,
>>
>> I added a new module to Karaf. The purpose of this module is to provide
>> means for scheduling tasks through the osgi service registry.
>>
>> The scheduler module registers a ServiceListener that listens for services
>> of the java.lang.Runnable interface that also have 2 service properties that
>> are required for scheduling:
>>
>> a) org.apache.karaf.scheduler.task.id (A string identifier for the task that
>> is going to be scheduled).
>> b) org.apache.karaf.scheduler.task.period (A long number that indicates the
>> execution period in milliseconds).
>>
>> Please note that all Runnable that don't have both properties will be
>> ignored. All other will be scheduled for execution via java Timer.
>>
>> I also plan to add shell commands for listing, rescheduling
>> & canceling events. It might be a goog idea to also add properties for
>> supporting cron expression etc.
>>
>> You can find the initial commit in the trunk.
>>
>> wdyt?
--
Glen Mazza
Application Integration Division
Talend (http://www.talend.com/ai)
blog: http://www.jroller.com/gmazza
Re: Introducing a task scheduler in Karaf
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ioannis,
It's a really good idea (we discussed of that for Cellar :)).
It could be very helpful for a large set of requirements.
I wonder:
1/ should it be a standard feature or an optional one (I think standard
is better as it doesn't require any resource if not used. It could be
comparable to the Scheduler that we find in an Oracle database).
2/ as for security/encryption (which use a simple encryption class or
Jasypt), maybe it could be interesting a use a simple scheduler (just a
Java Timer) and provide an optional feature to provide advanced
scheduling (cron, etc) which can be powered by Quartz
3/ add commands and console pages is a requirement. We can imagine
projects that could use Karaf as an enterprise scheduler (with team
escalation, etc).
Thanks
Regards
JB
On 07/20/2011 02:38 PM, Ioannis Canellos wrote:
> Hi,
>
> I added a new module to Karaf. The purpose of this module is to provide
> means for scheduling tasks through the osgi service registry.
>
> The scheduler module registers a ServiceListener that listens for services
> of the java.lang.Runnable interface that also have 2 service properties that
> are required for scheduling:
>
> a) org.apache.karaf.scheduler.task.id (A string identifier for the task that
> is going to be scheduled).
> b) org.apache.karaf.scheduler.task.period (A long number that indicates the
> execution period in milliseconds).
>
> Please note that all Runnable that don't have both properties will be
> ignored. All other will be scheduled for execution via java Timer.
>
> I also plan to add shell commands for listing, rescheduling
> & canceling events. It might be a goog idea to also add properties for
> supporting cron expression etc.
>
> You can find the initial commit in the trunk.
>
> wdyt?
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Introducing a task scheduler in Karaf
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Are you guys aware of http://sling.apache.org/site/scheduler-service-commons-scheduler.html?
On 20.07.2011 14:38:18 Ioannis Canellos wrote:
> Hi,
>
> I added a new module to Karaf. The purpose of this module is to provide
> means for scheduling tasks through the osgi service registry.
>
> The scheduler module registers a ServiceListener that listens for services
> of the java.lang.Runnable interface that also have 2 service properties that
> are required for scheduling:
>
> a) org.apache.karaf.scheduler.task.id (A string identifier for the task that
> is going to be scheduled).
> b) org.apache.karaf.scheduler.task.period (A long number that indicates the
> execution period in milliseconds).
>
> Please note that all Runnable that don't have both properties will be
> ignored. All other will be scheduled for execution via java Timer.
>
> I also plan to add shell commands for listing, rescheduling
> & canceling events. It might be a goog idea to also add properties for
> supporting cron expression etc.
>
> You can find the initial commit in the trunk.
>
> wdyt?
> --
> *Ioannis Canellos*
> *
> http://iocanel.blogspot.com
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> Apache ServiceMix <http://servicemix.apache.org/> Committer
> *
Jeremias Maerki