|
Hello,
I need to know how bundle start level works. I try to create a feture with two bundle <feature name='my-project' version='1.0.0'> <bundle start-level='90'>mvn:com.mycompany.myproject/myproject-service</bundle> <bundle start-level='85'>mvn:com.mycompany.myproject/myproject-dao</bundle> </feature> when the servicemix 4.4.1 (karaf) start and i make an osgi:list I see that myproject-dao load as first and not for second. but this is not 'the result I expected I missed something? thanks for help --Filippo |
|
Hi,
This is exactly how start-level in OSGi works, "lower" start-level means it need start first. Freeman On 2012-4-6, at 上午3:47, Filippo Balicchia wrote: > Hello, > I need to know how bundle start level works. > I try to create a feture with two bundle > <feature name='my-project' version='1.0.0'> > <bundle start-level='90'>mvn:com.mycompany.myproject/myproject- > service</bundle> > <bundle start-level='85'>mvn:com.mycompany.myproject/myproject- > dao</bundle> > </feature> > > when the servicemix 4.4.1 (karaf) start and i make an osgi:list I > see that > myproject-dao load as first and not for second. > > but this is not 'the result I expected > > I missed something? > > > thanks for help > --Filippo --------------------------------------------- Freeman Fang FuseSource Email:[hidden email] Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: http://weibo.com/u/1473905042 |
|
Excuse me but are very poorly explained.
I have a feature like this <feature name="myfeature" version="1.0.1-SNAPSHOT" start-level='110'> <bundle start-level='100'>file:location/bundle1</bundle> <bundle start-level='95'>file:location/bundle2</bundle> </feature> When I install my feature I see in the console [ 183] [Active ] [ ] [Started] [ 100] bundle1 [ 184] [Active ] [ ] [Waiting] [ 95] bundle2 I would have expected [ 183] [Active ] [ ] [Waiting] [ 95] bundle2 [ 184] [Active ] [ ] [Started] [ 100] bundle1 thanks for the explanation --Filippo Il 06 aprile 2012 01:18, Freeman Fang <[hidden email]> ha scritto: > Hi, > > This is exactly how start-level in OSGi works, "lower" start-level means it > need start first. > > Freeman > > On 2012-4-6, at 上午3:47, Filippo Balicchia wrote: > >> Hello, >> I need to know how bundle start level works. >> I try to create a feture with two bundle >> <feature name='my-project' version='1.0.0'> >> <bundle >> start-level='90'>mvn:com.mycompany.myproject/myproject-service</bundle> >> <bundle >> start-level='85'>mvn:com.mycompany.myproject/myproject-dao</bundle> >> </feature> >> >> when the servicemix 4.4.1 (karaf) start and i make an osgi:list I see that >> myproject-dao load as first and not for second. >> >> but this is not 'the result I expected >> >> I missed something? >> >> >> thanks for help >> --Filippo > > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:[hidden email] > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > http://blog.sina.com.cn/u/1473905042 > weibo: http://weibo.com/u/1473905042 > > > > > > > > > > |
|
Hi,
the bundle Id has nothing to do the start-level, it's controlled by the sequence you specify bundle in feature. Though you didn't ask, the spring status "Started" or "Waiting" also has nothing to do with the start-level, it's possible the that lower start-level bundle spring context completely up later than the higher start-level bundle, this is actually from the OSGi asyn nature. And business logic depend on bundle start sequence isn't good practice in OSGi world. The only way I know can guarantee the bundle fully start sequence is hold the OSGi service reference, or use spring/blueprint event listener in some cases also works. You can get more details from a related discussion [1] [1]http://servicemix.396122.n5.nabble.com/Active-Bundle-Not-exactly-Active-td5109090.html Freeman On 2012-4-6, at 下午3:08, Filippo Balicchia wrote: > Excuse me but are very poorly explained. > > > I have a feature like this > <feature name="myfeature" version="1.0.1-SNAPSHOT" start-level='110'> > <bundle start-level='100'>file:location/bundle1</bundle> > <bundle start-level='95'>file:location/bundle2</bundle> > </feature> > > When I install my feature I see in the console > > [ 183] [Active ] [ ] [Started] [ 100] bundle1 > [ 184] [Active ] [ ] [Waiting] [ 95] bundle2 > > > I would have expected > > [ 183] [Active ] [ ] [Waiting] [ 95] bundle2 > [ 184] [Active ] [ ] [Started] [ 100] bundle1 > > > thanks for the explanation > > --Filippo > > > Il 06 aprile 2012 01:18, Freeman Fang <[hidden email]> ha > scritto: >> Hi, >> >> This is exactly how start-level in OSGi works, "lower" start-level >> means it >> need start first. >> >> Freeman >> >> On 2012-4-6, at 上午3:47, Filippo Balicchia wrote: >> >>> Hello, >>> I need to know how bundle start level works. >>> I try to create a feture with two bundle >>> <feature name='my-project' version='1.0.0'> >>> <bundle >>> start-level='90'>mvn:com.mycompany.myproject/myproject-service</ >>> bundle> >>> <bundle >>> start-level='85'>mvn:com.mycompany.myproject/myproject-dao</bundle> >>> </feature> >>> >>> when the servicemix 4.4.1 (karaf) start and i make an osgi:list I >>> see that >>> myproject-dao load as first and not for second. >>> >>> but this is not 'the result I expected >>> >>> I missed something? >>> >>> >>> thanks for help >>> --Filippo >> >> >> --------------------------------------------- >> Freeman Fang >> >> FuseSource >> Email:[hidden email] >> Web: fusesource.com >> Twitter: freemanfang >> Blog: http://freemanfang.blogspot.com >> http://blog.sina.com.cn/u/1473905042 >> weibo: http://weibo.com/u/1473905042 >> >> >> >> >> >> >> >> >> >> --------------------------------------------- Freeman Fang FuseSource Email:[hidden email] Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: http://weibo.com/u/1473905042 |
| Powered by Nabble | Edit this page |
