You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Matthieu Vincent <mv...@gmail.com> on 2014/11/13 18:39:47 UTC
Bundle dependency
Hi
I'd like to know which is the better way to have some dependency between
2 bundles so that a bundle will not start before its dependency is in an
active state ?
Thanks for answers
Mat
Re: Bundle dependency
Posted by Kevin Schmidt <kt...@gmail.com>.
Using start levels isn't sufficient?
But what is the reason for wanting/needing the dependency? Understanding
the root issue may help identify a better solution.
On Thu, Nov 13, 2014 at 9:39 AM, Matthieu Vincent <mv...@gmail.com>
wrote:
> Hi
>
> I'd like to know which is the better way to have some dependency between
> 2 bundles so that a bundle will not start before its dependency is in an
> active state ?
>
> Thanks for answers
> Mat
>
Re: Bundle dependency
Posted by Matthieu Vincent <mv...@gmail.com>.
Hi all,
finally got this worked !
Using DS (based on spring) and the "depends-on" attribute for my bean, the
bundle hangs in Waiting until the reference is satisfied !
Thanks all for help
2014-11-14 16:37 GMT+01:00 Matthieu Vincent <mv...@gmail.com>:
> Thanks all for replies.
> I'll have a look at DS as I do not use blueprint in this project.
>
> I'll you know about my results
>
> Mat
>
> 2014-11-14 10:55 GMT+01:00 CLEMENT Jean-Philippe <
> jean-philippe.clement@fr.thalesgroup.com>:
>
>> Yes, I'm also wondering whether you really want "bundle2" to start after
>> "bundle1" or you just need a service of bundle1 in bundle2.
>>
>> From my understanding it is rather the latter case, then it's just OSGi
>> business as usual. Bundle1 takes the required time to start then publishes
>> the service when usable. Bundle2 also starts and waits the service to be
>> published, which can be done several ways, my preference would go to
>> Blueprint.
>>
>> Is the service dependency sufficient, or, if not, what is the extra need?
>>
>> JP
>>
>> [@@ OPEN @@]
>>
>> -----Message d'origine-----
>> De : Andreas Gies [mailto:andreas@wayofquality.de]
>> Envoyé : vendredi 14 novembre 2014 10:35
>> À : user@karaf.apache.org
>> Objet : Re: Bundle dependency
>>
>> Hi there,
>>
>> I am not sure where you are getting at with your question…I ll try to
>> answer anyway.
>>
>> The bundle start level is kind of a hint for the OSGi container runtime
>> in which order the bundles shall be started. AFAIK this is only organising
>> the invocation of the method and usually the “start up” activities of
>> several bundles will run in parallel. Furthermore, for 2 bundles with the
>> same start level you cannot predict the order in which the start methods
>> will be called.
>>
>>
>> Even if bundle B has a bigger startlevel than A you cannot assume that
>> the initilization of A has finished by the time the start method of B is
>> invoked. Especially if A registers one or more services those might not be
>> available at this point in time.
>>
>>
>> In that case you can use OSGi declarative services or the service
>> injection via blueprint. Essentially those will make sure that the
>> initialization of bundle B only proceed when A has registered it’s services.
>>
>> Personally I am using Scala/Akka for implementing my bundles and have
>> wrapped the OSGI Service Tracking API inside an Actor (which is more or
>> less what Blueprint or Declarative Services do as well). Using Scala and
>> Akka I can simply switch the Actor state from “Services unavailable” to
>> “Services available” und have functions registered that will be performed
>> on state transitions.
>>
>>
>> In a nutshell, if you have these kind of dependencies I believe you have
>> to decide on one of the service tracking schemes. Also take care that
>> service instances might be registered / deregistered over time and your
>> bundle should react accordingly if one of it’s dependencies is not
>> available.
>>
>>
>> Hope that helps
>> Andreas
>>
>>
>> > On 13 Nov 2014, at 18:39, Matthieu Vincent <mv...@gmail.com>
>> wrote:
>> >
>> > Hi
>> >
>> > I'd like to know which is the better way to have some dependency
>> between 2 bundles so that a bundle will not start before its dependency is
>> in an active state ?
>> >
>> > Thanks for answers
>> > Mat
>>
>>
>
Re: Bundle dependency
Posted by Matthieu Vincent <mv...@gmail.com>.
Thanks all for replies.
I'll have a look at DS as I do not use blueprint in this project.
I'll you know about my results
Mat
2014-11-14 10:55 GMT+01:00 CLEMENT Jean-Philippe <
jean-philippe.clement@fr.thalesgroup.com>:
> Yes, I'm also wondering whether you really want "bundle2" to start after
> "bundle1" or you just need a service of bundle1 in bundle2.
>
> From my understanding it is rather the latter case, then it's just OSGi
> business as usual. Bundle1 takes the required time to start then publishes
> the service when usable. Bundle2 also starts and waits the service to be
> published, which can be done several ways, my preference would go to
> Blueprint.
>
> Is the service dependency sufficient, or, if not, what is the extra need?
>
> JP
>
> [@@ OPEN @@]
>
> -----Message d'origine-----
> De : Andreas Gies [mailto:andreas@wayofquality.de]
> Envoyé : vendredi 14 novembre 2014 10:35
> À : user@karaf.apache.org
> Objet : Re: Bundle dependency
>
> Hi there,
>
> I am not sure where you are getting at with your question…I ll try to
> answer anyway.
>
> The bundle start level is kind of a hint for the OSGi container runtime in
> which order the bundles shall be started. AFAIK this is only organising the
> invocation of the method and usually the “start up” activities of several
> bundles will run in parallel. Furthermore, for 2 bundles with the same
> start level you cannot predict the order in which the start methods will be
> called.
>
>
> Even if bundle B has a bigger startlevel than A you cannot assume that the
> initilization of A has finished by the time the start method of B is
> invoked. Especially if A registers one or more services those might not be
> available at this point in time.
>
>
> In that case you can use OSGi declarative services or the service
> injection via blueprint. Essentially those will make sure that the
> initialization of bundle B only proceed when A has registered it’s services.
>
> Personally I am using Scala/Akka for implementing my bundles and have
> wrapped the OSGI Service Tracking API inside an Actor (which is more or
> less what Blueprint or Declarative Services do as well). Using Scala and
> Akka I can simply switch the Actor state from “Services unavailable” to
> “Services available” und have functions registered that will be performed
> on state transitions.
>
>
> In a nutshell, if you have these kind of dependencies I believe you have
> to decide on one of the service tracking schemes. Also take care that
> service instances might be registered / deregistered over time and your
> bundle should react accordingly if one of it’s dependencies is not
> available.
>
>
> Hope that helps
> Andreas
>
>
> > On 13 Nov 2014, at 18:39, Matthieu Vincent <mv...@gmail.com>
> wrote:
> >
> > Hi
> >
> > I'd like to know which is the better way to have some dependency
> between 2 bundles so that a bundle will not start before its dependency is
> in an active state ?
> >
> > Thanks for answers
> > Mat
>
>
RE: Bundle dependency
Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Yes, I'm also wondering whether you really want "bundle2" to start after "bundle1" or you just need a service of bundle1 in bundle2.
From my understanding it is rather the latter case, then it's just OSGi business as usual. Bundle1 takes the required time to start then publishes the service when usable. Bundle2 also starts and waits the service to be published, which can be done several ways, my preference would go to Blueprint.
Is the service dependency sufficient, or, if not, what is the extra need?
JP
[@@ OPEN @@]
-----Message d'origine-----
De : Andreas Gies [mailto:andreas@wayofquality.de]
Envoyé : vendredi 14 novembre 2014 10:35
À : user@karaf.apache.org
Objet : Re: Bundle dependency
Hi there,
I am not sure where you are getting at with your question…I ll try to answer anyway.
The bundle start level is kind of a hint for the OSGi container runtime in which order the bundles shall be started. AFAIK this is only organising the invocation of the method and usually the “start up” activities of several bundles will run in parallel. Furthermore, for 2 bundles with the same start level you cannot predict the order in which the start methods will be called.
Even if bundle B has a bigger startlevel than A you cannot assume that the initilization of A has finished by the time the start method of B is invoked. Especially if A registers one or more services those might not be available at this point in time.
In that case you can use OSGi declarative services or the service injection via blueprint. Essentially those will make sure that the initialization of bundle B only proceed when A has registered it’s services.
Personally I am using Scala/Akka for implementing my bundles and have wrapped the OSGI Service Tracking API inside an Actor (which is more or less what Blueprint or Declarative Services do as well). Using Scala and Akka I can simply switch the Actor state from “Services unavailable” to “Services available” und have functions registered that will be performed on state transitions.
In a nutshell, if you have these kind of dependencies I believe you have to decide on one of the service tracking schemes. Also take care that service instances might be registered / deregistered over time and your bundle should react accordingly if one of it’s dependencies is not available.
Hope that helps
Andreas
> On 13 Nov 2014, at 18:39, Matthieu Vincent <mv...@gmail.com> wrote:
>
> Hi
>
> I'd like to know which is the better way to have some dependency between 2 bundles so that a bundle will not start before its dependency is in an active state ?
>
> Thanks for answers
> Mat
Re: Bundle dependency
Posted by Andreas Gies <an...@wayofquality.de>.
Hi there,
I am not sure where you are getting at with your question…I ll try to answer anyway.
The bundle start level is kind of a hint for the OSGi container runtime in which order the bundles shall be started. AFAIK this is only organising the invocation of the method and usually the “start up” activities of several bundles will run in parallel. Furthermore, for 2 bundles with the same start level you cannot predict the order in which the start methods will be called.
Even if bundle B has a bigger startlevel than A you cannot assume that the initilization of A has finished by the time the start method of B is invoked. Especially if A registers one or more services those might not be available at this point in time.
In that case you can use OSGi declarative services or the service injection via blueprint. Essentially those will make sure that the initialization of bundle B only proceed when A has registered it’s services.
Personally I am using Scala/Akka for implementing my bundles and have wrapped the OSGI Service Tracking API inside an Actor (which is more or less what Blueprint or Declarative Services do as well). Using Scala and Akka I can simply switch the Actor state from “Services unavailable” to “Services available” und have functions registered that will be performed on state transitions.
In a nutshell, if you have these kind of dependencies I believe you have to decide on one of the service tracking schemes. Also take care that service instances might be registered / deregistered over time and your bundle should react accordingly if one of it’s dependencies is not available.
Hope that helps
Andreas
> On 13 Nov 2014, at 18:39, Matthieu Vincent <mv...@gmail.com> wrote:
>
> Hi
>
> I'd like to know which is the better way to have some dependency between 2 bundles so that a bundle will not start before its dependency is in an active state ?
>
> Thanks for answers
> Mat
Re: Bundle dependency
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Matthieu,
for Declarative Services (DS) you might want to take a look at [1].
It's basically a "Boilerplate code free" ServiceTracking :)
regards, Achim
[1] - http://wiki.osgi.org/wiki/Declarative_Services
2014-11-13 22:18 GMT+01:00 Matthieu Vincent <mv...@gmail.com>:
> Hi Achim
>
> Can u tell me more about your DS idea ?
>
> Thanks
> Le 13 nov. 2014 21:32, "Achim Nierbeck" <bc...@googlemail.com> a écrit
> :
>
> Hi,
>>
>> if you use a service tracker you don't need a while loop, cause it will
>> "active" in the second the service is available.
>> Best to do that without blueprint, blueprint does have a graceperiod.
>> Maybe DS is more suitable for this.
>>
>> regards, Achim
>>
>> 2014-11-13 21:20 GMT+01:00 Matthieu Vincent <mv...@gmail.com>:
>>
>>> Hi
>>>
>>> I was thinking about using either activator or tracker.
>>>
>>> But in both cases, if business service is unavailable the bundle will go
>>> in failure. So I need to use some monitoring to restart bundle after a
>>> while.
>>> Other option can be a kind of while loop to wait fort service but i dont
>>> really like the idea.
>>>
>>> I'm mostly based on spring configuration.
>>> Le 13 nov. 2014 20:00, "Jean-Baptiste Onofré" <jb...@nanthrax.net> a écrit
>>> :
>>>
>>> Hi,
>>>>
>>>> maybe you can manage using the Activator to check the state of the
>>>> service or other bundle.
>>>>
>>>> Can you describe a bit what you use (blueprint, DS, etc) ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 11/13/2014 07:50 PM, Matthieu Vincent wrote:
>>>>
>>>>> Hi all
>>>>>
>>>>> My problem is thar i've got a bundle starting consumer en JMS queues
>>>>> that must wait for my business bundle to start which can be "long" so i
>>>>> need the first one to wait thé second.
>>>>>
>>>>> Features and start level didn't fix my problem. I've already tried.
>>>>>
>>>>> Mat
>>>>>
>>>>> Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb@nanthrax.net
>>>>> <ma...@nanthrax.net>> a écrit :
>>>>>
>>>>> Hi Matthieu,
>>>>>
>>>>> you can use start-level, but honestly, I would recommend to use
>>>>> features.
>>>>>
>>>>> Let say, you have bundle1 and bundle2, where bundle2 depends to
>>>>> bundle1.
>>>>>
>>>>> You can define:
>>>>>
>>>>> <feature version="1.0" name="feature1">
>>>>> <bundle>.../bundle1</bundle>
>>>>> </feature>
>>>>>
>>>>> <feature version="1.0" name="feature2">
>>>>> <feature version="1.0">feature1</__feature>
>>>>> <bundle>../bundle2</bundle>
>>>>> </feature>
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>>>>>
>>>>> Hi
>>>>>
>>>>> I'd like to know which is the better way to have some
>>>>> dependency
>>>>> between 2 bundles so that a bundle will not start before its
>>>>> dependency
>>>>> is in an active state ?
>>>>>
>>>>> Thanks for answers
>>>>> Mat
>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org <ma...@apache.org>
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>
>>
>>
>> --
>>
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
>> & Project Lead
>> blog <http://notizblog.nierbeck.de/>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>>
>> Software Architect / Project Manager / Scrum Master
>>
>>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Bundle dependency
Posted by Matthieu Vincent <mv...@gmail.com>.
Hi Achim
Can u tell me more about your DS idea ?
Thanks
Le 13 nov. 2014 21:32, "Achim Nierbeck" <bc...@googlemail.com> a écrit :
> Hi,
>
> if you use a service tracker you don't need a while loop, cause it will
> "active" in the second the service is available.
> Best to do that without blueprint, blueprint does have a graceperiod.
> Maybe DS is more suitable for this.
>
> regards, Achim
>
> 2014-11-13 21:20 GMT+01:00 Matthieu Vincent <mv...@gmail.com>:
>
>> Hi
>>
>> I was thinking about using either activator or tracker.
>>
>> But in both cases, if business service is unavailable the bundle will go
>> in failure. So I need to use some monitoring to restart bundle after a
>> while.
>> Other option can be a kind of while loop to wait fort service but i dont
>> really like the idea.
>>
>> I'm mostly based on spring configuration.
>> Le 13 nov. 2014 20:00, "Jean-Baptiste Onofré" <jb...@nanthrax.net> a écrit :
>>
>> Hi,
>>>
>>> maybe you can manage using the Activator to check the state of the
>>> service or other bundle.
>>>
>>> Can you describe a bit what you use (blueprint, DS, etc) ?
>>>
>>> Regards
>>> JB
>>>
>>> On 11/13/2014 07:50 PM, Matthieu Vincent wrote:
>>>
>>>> Hi all
>>>>
>>>> My problem is thar i've got a bundle starting consumer en JMS queues
>>>> that must wait for my business bundle to start which can be "long" so i
>>>> need the first one to wait thé second.
>>>>
>>>> Features and start level didn't fix my problem. I've already tried.
>>>>
>>>> Mat
>>>>
>>>> Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb@nanthrax.net
>>>> <ma...@nanthrax.net>> a écrit :
>>>>
>>>> Hi Matthieu,
>>>>
>>>> you can use start-level, but honestly, I would recommend to use
>>>> features.
>>>>
>>>> Let say, you have bundle1 and bundle2, where bundle2 depends to
>>>> bundle1.
>>>>
>>>> You can define:
>>>>
>>>> <feature version="1.0" name="feature1">
>>>> <bundle>.../bundle1</bundle>
>>>> </feature>
>>>>
>>>> <feature version="1.0" name="feature2">
>>>> <feature version="1.0">feature1</__feature>
>>>> <bundle>../bundle2</bundle>
>>>> </feature>
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>>>>
>>>> Hi
>>>>
>>>> I'd like to know which is the better way to have some
>>>> dependency
>>>> between 2 bundles so that a bundle will not start before its
>>>> dependency
>>>> is in an active state ?
>>>>
>>>> Thanks for answers
>>>> Mat
>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org <ma...@apache.org>
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
Re: Bundle dependency
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,
if you use a service tracker you don't need a while loop, cause it will
"active" in the second the service is available.
Best to do that without blueprint, blueprint does have a graceperiod. Maybe
DS is more suitable for this.
regards, Achim
2014-11-13 21:20 GMT+01:00 Matthieu Vincent <mv...@gmail.com>:
> Hi
>
> I was thinking about using either activator or tracker.
>
> But in both cases, if business service is unavailable the bundle will go
> in failure. So I need to use some monitoring to restart bundle after a
> while.
> Other option can be a kind of while loop to wait fort service but i dont
> really like the idea.
>
> I'm mostly based on spring configuration.
> Le 13 nov. 2014 20:00, "Jean-Baptiste Onofré" <jb...@nanthrax.net> a écrit :
>
> Hi,
>>
>> maybe you can manage using the Activator to check the state of the
>> service or other bundle.
>>
>> Can you describe a bit what you use (blueprint, DS, etc) ?
>>
>> Regards
>> JB
>>
>> On 11/13/2014 07:50 PM, Matthieu Vincent wrote:
>>
>>> Hi all
>>>
>>> My problem is thar i've got a bundle starting consumer en JMS queues
>>> that must wait for my business bundle to start which can be "long" so i
>>> need the first one to wait thé second.
>>>
>>> Features and start level didn't fix my problem. I've already tried.
>>>
>>> Mat
>>>
>>> Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb@nanthrax.net
>>> <ma...@nanthrax.net>> a écrit :
>>>
>>> Hi Matthieu,
>>>
>>> you can use start-level, but honestly, I would recommend to use
>>> features.
>>>
>>> Let say, you have bundle1 and bundle2, where bundle2 depends to
>>> bundle1.
>>>
>>> You can define:
>>>
>>> <feature version="1.0" name="feature1">
>>> <bundle>.../bundle1</bundle>
>>> </feature>
>>>
>>> <feature version="1.0" name="feature2">
>>> <feature version="1.0">feature1</__feature>
>>> <bundle>../bundle2</bundle>
>>> </feature>
>>>
>>> Regards
>>> JB
>>>
>>> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>>>
>>> Hi
>>>
>>> I'd like to know which is the better way to have some
>>> dependency
>>> between 2 bundles so that a bundle will not start before its
>>> dependency
>>> is in an active state ?
>>>
>>> Thanks for answers
>>> Mat
>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org <ma...@apache.org>
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: Bundle dependency
Posted by Matthieu Vincent <mv...@gmail.com>.
Hi
I was thinking about using either activator or tracker.
But in both cases, if business service is unavailable the bundle will go in
failure. So I need to use some monitoring to restart bundle after a while.
Other option can be a kind of while loop to wait fort service but i dont
really like the idea.
I'm mostly based on spring configuration.
Le 13 nov. 2014 20:00, "Jean-Baptiste Onofré" <jb...@nanthrax.net> a écrit :
> Hi,
>
> maybe you can manage using the Activator to check the state of the service
> or other bundle.
>
> Can you describe a bit what you use (blueprint, DS, etc) ?
>
> Regards
> JB
>
> On 11/13/2014 07:50 PM, Matthieu Vincent wrote:
>
>> Hi all
>>
>> My problem is thar i've got a bundle starting consumer en JMS queues
>> that must wait for my business bundle to start which can be "long" so i
>> need the first one to wait thé second.
>>
>> Features and start level didn't fix my problem. I've already tried.
>>
>> Mat
>>
>> Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb@nanthrax.net
>> <ma...@nanthrax.net>> a écrit :
>>
>> Hi Matthieu,
>>
>> you can use start-level, but honestly, I would recommend to use
>> features.
>>
>> Let say, you have bundle1 and bundle2, where bundle2 depends to
>> bundle1.
>>
>> You can define:
>>
>> <feature version="1.0" name="feature1">
>> <bundle>.../bundle1</bundle>
>> </feature>
>>
>> <feature version="1.0" name="feature2">
>> <feature version="1.0">feature1</__feature>
>> <bundle>../bundle2</bundle>
>> </feature>
>>
>> Regards
>> JB
>>
>> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>>
>> Hi
>>
>> I'd like to know which is the better way to have some
>> dependency
>> between 2 bundles so that a bundle will not start before its
>> dependency
>> is in an active state ?
>>
>> Thanks for answers
>> Mat
>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org <ma...@apache.org>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
Re: Bundle dependency
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
maybe you can manage using the Activator to check the state of the
service or other bundle.
Can you describe a bit what you use (blueprint, DS, etc) ?
Regards
JB
On 11/13/2014 07:50 PM, Matthieu Vincent wrote:
> Hi all
>
> My problem is thar i've got a bundle starting consumer en JMS queues
> that must wait for my business bundle to start which can be "long" so i
> need the first one to wait thé second.
>
> Features and start level didn't fix my problem. I've already tried.
>
> Mat
>
> Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb@nanthrax.net
> <ma...@nanthrax.net>> a écrit :
>
> Hi Matthieu,
>
> you can use start-level, but honestly, I would recommend to use
> features.
>
> Let say, you have bundle1 and bundle2, where bundle2 depends to bundle1.
>
> You can define:
>
> <feature version="1.0" name="feature1">
> <bundle>.../bundle1</bundle>
> </feature>
>
> <feature version="1.0" name="feature2">
> <feature version="1.0">feature1</__feature>
> <bundle>../bundle2</bundle>
> </feature>
>
> Regards
> JB
>
> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>
> Hi
>
> I'd like to know which is the better way to have some dependency
> between 2 bundles so that a bundle will not start before its
> dependency
> is in an active state ?
>
> Thanks for answers
> Mat
>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle dependency
Posted by Matthieu Vincent <mv...@gmail.com>.
Hi all
My problem is thar i've got a bundle starting consumer en JMS queues that
must wait for my business bundle to start which can be "long" so i need the
first one to wait thé second.
Features and start level didn't fix my problem. I've already tried.
Mat
Le 13 nov. 2014 19:34, "Jean-Baptiste Onofré" <jb...@nanthrax.net> a écrit :
> Hi Matthieu,
>
> you can use start-level, but honestly, I would recommend to use features.
>
> Let say, you have bundle1 and bundle2, where bundle2 depends to bundle1.
>
> You can define:
>
> <feature version="1.0" name="feature1">
> <bundle>.../bundle1</bundle>
> </feature>
>
> <feature version="1.0" name="feature2">
> <feature version="1.0">feature1</feature>
> <bundle>../bundle2</bundle>
> </feature>
>
> Regards
> JB
>
> On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
>
>> Hi
>>
>> I'd like to know which is the better way to have some dependency
>> between 2 bundles so that a bundle will not start before its dependency
>> is in an active state ?
>>
>> Thanks for answers
>> Mat
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
Re: Bundle dependency
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Matthieu,
you can use start-level, but honestly, I would recommend to use features.
Let say, you have bundle1 and bundle2, where bundle2 depends to bundle1.
You can define:
<feature version="1.0" name="feature1">
<bundle>.../bundle1</bundle>
</feature>
<feature version="1.0" name="feature2">
<feature version="1.0">feature1</feature>
<bundle>../bundle2</bundle>
</feature>
Regards
JB
On 11/13/2014 06:39 PM, Matthieu Vincent wrote:
> Hi
>
> I'd like to know which is the better way to have some dependency
> between 2 bundles so that a bundle will not start before its dependency
> is in an active state ?
>
> Thanks for answers
> Mat
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com