Christian,
> If you are more concerned about starting or not starting things
> conditionally this could be more interesting. I am not sure if and how
> existing frameworks handle this case.
Yes, I concerned about starting or not starting things conditionally.
> This is still too generic I think. Can you describe a bit what kind of
> rules you have in mind?
Well, I take an example as following:
[A Bundle]
Class1's definition:
@Service
@StartMode(mode=Mode.StartupMode)
public class Class1{
...
}
[B Bundle]
Class2's definition:
@Service
@StartMode(mode=Mode.CommonMode, level=20)
public class Class2{
...
}
Case1: After we installed A bundle and B bundle, if having an agent
bundle being charge of control current system's running state(eg. decide
what should start or not start), the agent can define a system run
level(eg. 15), then, once it found that Class1 from A Bundle has
"mode=Mode.StartupMode", it will start A Bundle.
Case2: If in the future, we decide to install B Bundle, and the agent
bundle found Class2 from B Bundle has "level=20" which is higher than
current system run level. Then, maybe it will not start B bundle. Of
course, this is only a simple rule.
Thanks
Tang
Christian Schneider wrote:
This is still too generic I think. Can you describe a bit what kind of
rules you have in mind?
Are you mainly concerned about starting things in the right order or
more about starting or not starting things at all?
For starting things in order there are some great frameworks already.
Typically you simply define what services you offer and need using
annotations and the framework takes care of the start order.
If you are more concerned about starting or not starting things
conditionally this could be more interesting. I am not sure if and how
existing frameworks handle this case.
Christian
On 19.12.2013 09:35, Tang Yong wrote:
Christian
Thanks quick reply very much!
> In general the main question is: What do you want to achieve with your
> described agent. What is the actual problem you are facing?
Well, I will say detailed background as following:
Asumming there is an application server made up many modules or OSGi
bundles, these bundles are divided into two catogories, one is
developed by the application server team,called system bundle and the
other is developed by the third part.
For system bundles, the application server has itself module starting
rule, Eg. by defining some annotations in some classes, then, runtime
can scan these annotations and while kernel is starting, it can start
these system bundles adaptivly.
However, for the third part bundles, we will have no chance or better
way liking system bundles to start them adaptivly.
If defining some metadata or rules in Spec, maybe we will have better
general way to unify such behavior.
Maybe I still have not said clearly. I am sorry...
Thanks
Tang
--
----------------------
Tang Yong
Senior Engineer
GlassFish Committer (OSGi & OSGi-JavaEE)
OSGi Alliance Supporter
Blog: http://osgizone.typepad.com/tangyong/
Nanjing Fujitsu NanDa Software Tec CO.,LTD
http://www.fujitsu.com/cn/fnst
Tel: +86-25-86630566-8310
Fax: +86-25-83317685
----------------------
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev