You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Elvy <pi...@gmail.com> on 2008/04/24 19:40:20 UTC

SCR and bundle activation order

Hi,

I'd like to use declarative services to install/start all the bundle in a
given folder, and let them activate themselves properly.

I've got 3 bundle A <- B <- C (C depends on B which depends on A)

First one to start is A : OK
Second is C              : unresolved package error because it needs
packages provided by B


I hove to tell you than if I rename C, so it is found before B, then
everything works, obviously :)

How does this SCR thing work? HEEEEELP :(

___ here's my .xml for C ___
 
<?xml version="1.0" encoding="UTF-8"?>
<component name="my.name" immediate="true">

    <implementation class="my.impl"/>

    <property name="service.description" value="Demo."/>
    <property name="service.vendor" value="Pigelvy"/>

    <!-- provided by A -->  
    <reference name="ted"
               interface="org.elvya.A"
               cardinality="1..1"
               policy="static"
               bind="bindApplication"
               unbind="unbindApplication"/>

    <!-- provided by B -->  
    <reference name="entity plugin"
               interface="org.elvyb.b"
               cardinality="1..1"
               policy="static" />

</component>


-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/SCR-and-bundle-activation-order-tp16851288p16851288.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: SCR and bundle activation order

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Elvy wrote:
> Installing all found bundles, then starting them does work indead. ;)
>
> One last question though : 
>
> Is this standard OSGi behaviour or just the way Felix works? I read the
> Declarative Services Specification v1.0 and, if I'm not wrong, I found no
> details about start order...
>
> I want my application to be compliante with OSGi r4 specs, and thus, work
> the same may it be on Felix, Equinox or others.
>   

This is standard OSGi stuff and has nothing to do with Declarative 
Services, it has to do with package resolving. A bundle cannot be 
resolved unless the packages it needs from other bundles are already 
available (i.e., installed in the framework). Thus, if you install 
everything first, then you are guaranteed to have everything available. 
After you install all the bundles, the order in which you start them 
should not make a difference, however.

-> richard

>
>
> Richard S. Hall wrote:
>   
>> Perhaps you should go through and install them all first, then make 
>> another pass to start each.
>>
>> -> richard
>>
>> Elvy wrote:
>>     
>>> Hi,
>>>
>>> I'd like to use declarative services to install/start all the bundle in a
>>> given folder, and let them activate themselves properly.
>>>
>>> I've got 3 bundle A <- B <- C (C depends on B which depends on A)
>>>
>>> First one to start is A : OK
>>> Second is C              : unresolved package error because it needs
>>> packages provided by B
>>>
>>>
>>> I hove to tell you than if I rename C, so it is found before B, then
>>> everything works, obviously :)
>>>       
>>
>>     
>
>
> -----
> Tell me something you don't know!
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: SCR and bundle activation order

Posted by Elvy <pi...@gmail.com>.
Installing all found bundles, then starting them does work indead. ;)

One last question though : 

Is this standard OSGi behaviour or just the way Felix works? I read the
Declarative Services Specification v1.0 and, if I'm not wrong, I found no
details about start order...

I want my application to be compliante with OSGi r4 specs, and thus, work
the same may it be on Felix, Equinox or others.

Thanx




Richard S. Hall wrote:
> 
> Perhaps you should go through and install them all first, then make 
> another pass to start each.
> 
> -> richard
> 
> Elvy wrote:
>> Hi,
>>
>> I'd like to use declarative services to install/start all the bundle in a
>> given folder, and let them activate themselves properly.
>>
>> I've got 3 bundle A <- B <- C (C depends on B which depends on A)
>>
>> First one to start is A : OK
>> Second is C              : unresolved package error because it needs
>> packages provided by B
>>
>>
>> I hove to tell you than if I rename C, so it is found before B, then
>> everything works, obviously :)
> 
> 
> 


-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/SCR-and-bundle-activation-order-tp16851288p16892295.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: SCR and bundle activation order

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Perhaps you should go through and install them all first, then make 
another pass to start each.

-> richard

Elvy wrote:
> Hi,
>
> I'd like to use declarative services to install/start all the bundle in a
> given folder, and let them activate themselves properly.
>
> I've got 3 bundle A <- B <- C (C depends on B which depends on A)
>
> First one to start is A : OK
> Second is C              : unresolved package error because it needs
> packages provided by B
>
>
> I hove to tell you than if I rename C, so it is found before B, then
> everything works, obviously :)
>
> How does this SCR thing work? HEEEEELP :(
>
> ___ here's my .xml for C ___
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <component name="my.name" immediate="true">
>
>     <implementation class="my.impl"/>
>
>     <property name="service.description" value="Demo."/>
>     <property name="service.vendor" value="Pigelvy"/>
>
>     <!-- provided by A -->  
>     <reference name="ted"
>                interface="org.elvya.A"
>                cardinality="1..1"
>                policy="static"
>                bind="bindApplication"
>                unbind="unbindApplication"/>
>
>     <!-- provided by B -->  
>     <reference name="entity plugin"
>                interface="org.elvyb.b"
>                cardinality="1..1"
>                policy="static" />
>
> </component>
>
>
> -----
> Tell me something you don't know!
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org