Virtual bundles?! [message #126906] |
Tue, 03 March 2009 12:26 |
Matthias Treitler Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi,
Recently a very interesting idea came up:
First I will tell you my requirements. The goal of my project is rather
simple: Implement a scheduler, which executes tasks. Those tasks can be
executed like a cron job, and can be also called sequentially at any time,
and also can be stopped at any time.
Such logic of a task is implemented in bundles. Up to now when starting my
application all bundles are started and then the scheduler calls a start
and stop method of this bundle. So the start and stop behavior is
implemented by the application.
But what is if I would handle the start/stop routine by OSGi itself, by
using the bundles lifecycle start() and stop() methods in the
BundleActivator?!? I think that would be a good idea and much cleaner to
implement. Also a big advantage would be that the costumer of such an
task, has to implement less, and also stopping a bundle cleans all memory
data.
However, as far as I know a bundle can only be started once at a time; it
is just like a singleton object.
It would be possible if OSGi would have the concept of a "virtual" bundle.
A physical bundle that can be started a number of times, each having the
nature of a "normal" bundle.
What do you think?!? Do you have any ideas on this topic?!
Cheers,
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03849 seconds