[ 
https://issues.apache.org/jira/browse/FELIX-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484896
 ] 

Felix Meschberger commented on FELIX-112:
-----------------------------------------

Hi Didier,

I just committed a major rework of the scr project which - hopefully - also 
solves your issue. Could you please verify, whether this is the case ? Thanks.

Regards
Felix

> activate() calls do not match with deactivate() calls for a delayed component 
> (immediate="false") and service instances are multiple (although there is no 
> factory)
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-112
>                 URL: https://issues.apache.org/jira/browse/FELIX-112
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services
>    Affects Versions: 0.8.0
>         Environment: WinXP, Sun JDK 5.0
>            Reporter: Didier DONSEZ
>
> activate() calls do not match with deactivate() calls for a delayed component 
> (immediate="false")
> and service instances are multiple (although there is no factory)
> See the first trace.
> If the component is immediate (immediate="false"), the behavior is correct : 
> see the second trace.
> The instance is the same singleton for the two clients.
> Didier
> ========================
> TRACE WITH immediate="false"
> ========================
> <?xml version="1.0" encoding="UTF-8"?>
> <component name="Hello.Service" immediate="false">
>       <!-- for immediate="false", see 112.5.4 Delayed Component -->
>       <implementation 
> class="fr.imag.adele.bundle.helloservicescr.impl.HelloServiceImpl"/>
>       <property name="language" value="fr"/>
>       <service>
>               <provide interface="fr.imag.adele.bundle.hello.HelloService"/>
>       </service>
> </component>
> -> ps
> START LEVEL 1
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (0.8.0.SNAPSHOT)
> [   1] [Active     ] [    1] ShellService (0.8.0.SNAPSHOT)
> [   2] [Active     ] [    1] ShellTUI (0.8.0.SNAPSHOT)
> [   3] [Active     ] [    1] BundleRepository (0.8.0.SNAPSHOT)
> [   4] [Active     ] [    1] servlet (2.1)
> [   5] [Active     ] [    1] osgi.compendium (4)
> [   6] [Active     ] [    1] Service Component Runtime (0.8.0.SNAPSHOT)
> [   7] [Resolved   ] [    1] Hello Service Specification 1.2 (0.3.0)
> [   8] [Resolved   ] [    1] Hello Command (with SCR) (0.1.0)
> [   9] [Resolved   ] [    1] Hello Service Impl 1.1 SCR (0.1.0)
> [  10] [Resolved   ] [    1] Hello Requester Impl 1.1 SCR (0.1.0)
> -> start 9
> --- [Hello.Service] Validated and registered component
> --- [Hello.Service] ManagerFactory.createManager
> --- [Hello.Service] Enabling component
> --- [Hello.Service] State transition : CREATING -> CREATED
> --- [Hello.Service] State transition : CREATED -> VALIDATING
> --- [Hello.Service] State transition : VALIDATING -> VALID
> --- [Hello.Service] registering services
> -> start 8
> --- [Hello.Cmd] Validated and registered component
> --- [Hello.Cmd] ManagerFactory.createManager
> --- [Hello.Cmd] Enabling component
> --- [Hello.Cmd] State transition : CREATING -> CREATED
> --- [Hello.Cmd] State transition : CREATED -> VALIDATING
> --- [Hello.Cmd] State transition : VALIDATING -> VALID
> --- [Hello.Cmd] registering services
> --- [Hello.Cmd] DelayedComponentServiceFactory.getService()
> --- [Hello.Service] DelayedComponentServiceFactory.getService()
> (Bundle #9) call activate
> (Bundle #8) call activate
> -> hello Didier
> Hello  Didier (from [EMAIL PROTECTED]) !!
> -> stop 8
> --- [Hello.Cmd] State transition : VALID -> DESTROYING
> --- [Hello.Cmd] unregistering the services
> (Bundle #8) call deactivate
> --- [Hello.Cmd] getting unbind: unbindHelloService
> --- [Hello.Cmd] State transition : DESTROYING -> DESTROYED
> -> start 8
> --- [Hello.Cmd] Validated and registered component
> --- [Hello.Cmd] ManagerFactory.createManager
> --- [Hello.Cmd] Enabling component
> --- [Hello.Cmd] State transition : CREATING -> CREATED
> --- [Hello.Cmd] State transition : CREATED -> VALIDATING
> --- [Hello.Cmd] State transition : VALIDATING -> VALID
> --- [Hello.Cmd] registering services
> --- [Hello.Cmd] DelayedComponentServiceFactory.getService()
> --- [Hello.Service] DelayedComponentServiceFactory.getService()
> (Bundle #9) call activate
> (Bundle #8) call activate
> -> hello Rick
> Hello  Rick (from [EMAIL PROTECTED]) !!
> -> start 10
> --- [Hello.Requester.11] Validated and registered component
> --- [Hello.Requester.11] ManagerFactory.createManager
> --- [Hello.Requester.11] Enabling component
> --- [Hello.Requester.11] State transition : CREATING -> CREATED
> --- [Hello.Requester.11] State transition : CREATED -> VALIDATING
> --- [Hello.Service] DelayedComponentServiceFactory.getService()
> (Bundle #9) call activate
> (Bundle #10) call activate
> --- [Hello.Requester.11] State transition : VALIDATING -> VALID
> -> (Bundle #10) 1:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 2:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 3:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 4:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 5:[EMAIL PROTECTED] says '
> Hello World !!
> '
> hello Rick
> (Bundle #10) 6:fr.imag.adele.bundle.helloservicescr.impl.HelloServiceI
> [EMAIL PROTECTED] says '
> Hello World !!
> '
> Hello  Rick (from [EMAIL PROTECTED]) !!
> -> (Bundle #10) 7:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 8:[EMAIL PROTECTED]
>  says '
> Hello World !!
> '
> (Bundle #10) 9:[EMAIL PROTECTED]
>  says '
> Hello World !!
> '
> stop 10
> --- [Hello.Requester.11] State transition : VALID -> DESTROYING
> (Bundle #10) call deactivate
> --- [Hello.Requester.11] getting unbind: unbindHelloService
> --- [Hello.Requester.11] State transition : DESTROYING -> DESTROYED
> -> services 9
> Hello Service Impl 1.1 SCR (9) provides:
> ----------------------------------------
> language = fr
> objectClass = fr.imag.adele.bundle.hello.HelloService
> service.id = 37
> -> (Bundle #10) thread completed
> stop 8
> --- [Hello.Cmd] State transition : VALID -> DESTROYING
> --- [Hello.Cmd] unregistering the services
> (Bundle #8) call deactivate
> --- [Hello.Cmd] getting unbind: unbindHelloService
> --- [Hello.Cmd] State transition : DESTROYING -> DESTROYED
> -> stop 9
> --- [Hello.Service] State transition : VALID -> DESTROYING
> --- [Hello.Service] unregistering the services
> (Bundle #9) call deactivate
> --- [Hello.Service] State transition : DESTROYING -> DESTROYED
> ->
> ========================
> TRACE WITH immediate="true"
> ========================
> <?xml version="1.0" encoding="UTF-8"?>
> <component name="Hello.Service" immediate="true">
>       <!-- for immediate="false", see 112.5.4 Delayed Component -->
>       <implementation 
> class="fr.imag.adele.bundle.helloservicescr.impl.HelloServiceImpl"/>
>       <property name="language" value="fr"/>
>       <service>
>               <provide interface="fr.imag.adele.bundle.hello.HelloService"/>
>       </service>
> </component>
> -> ps
> START LEVEL 1
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (0.8.0.SNAPSHOT)
> [   1] [Active     ] [    1] ShellService (0.8.0.SNAPSHOT)
> [   2] [Active     ] [    1] ShellTUI (0.8.0.SNAPSHOT)
> [   3] [Active     ] [    1] BundleRepository (0.8.0.SNAPSHOT)
> [   4] [Active     ] [    1] servlet (2.1)
> [   5] [Active     ] [    1] osgi.compendium (4)
> [   6] [Active     ] [    1] Service Component Runtime (0.8.0.SNAPSHOT)
> [   7] [Resolved   ] [    1] Hello Service Specification 1.2 (0.3.0)
> [   8] [Resolved   ] [    1] Hello Command (with SCR) (0.1.0)
> [   9] [Resolved   ] [    1] Hello Service Impl 1.1 SCR (0.1.0)
> [  10] [Resolved   ] [    1] Hello Requester Impl 1.1 SCR (0.1.0)
> ->
> ->
> -> start 9
> --- [Hello.Service] Validated and registered component
> --- [Hello.Service] ManagerFactory.createManager
> --- [Hello.Service] Enabling component
> --- [Hello.Service] State transition : CREATING -> CREATED
> --- [Hello.Service] State transition : CREATED -> VALIDATING
> (Bundle #9) call activate
> --- [Hello.Service] State transition : VALIDATING -> VALID
> --- [Hello.Service] registering services
> -> start 8
> --- [Hello.Cmd] Validated and registered component
> --- [Hello.Cmd] ManagerFactory.createManager
> --- [Hello.Cmd] Enabling component
> --- [Hello.Cmd] State transition : CREATING -> CREATED
> --- [Hello.Cmd] State transition : CREATED -> VALIDATING
> --- [Hello.Cmd] State transition : VALIDATING -> VALID
> --- [Hello.Cmd] registering services
> --- [Hello.Cmd] DelayedComponentServiceFactory.getService()
> (Bundle #8) call activate
> -> hello Rick
> Hello  Rick (from [EMAIL PROTECTED]) !!
> -> start 10
> --- [Hello.Requester.11] Validated and registered component
> --- [Hello.Requester.11] ManagerFactory.createManager
> --- [Hello.Requester.11] Enabling component
> --- [Hello.Requester.11] State transition : CREATING -> CREATED
> --- [Hello.Requester.11] State transition : CREATED -> VALIDATING
> (Bundle #10) call activate
> --- [(Bundle #10) 1:[EMAIL PROTECTED] says '
> Hello World !!
> '
> Hello.Requester.11] State transition : VALIDATING -> VALID
> -> (Bundle #10) 2:[EMAIL PROTECTED] says '
> Hello World !!
> '
> (Bundle #10) 3:[EMAIL PROTECTED]
>  says '
> Hello World !!
> '
> (Bundle #10) 4:[EMAIL PROTECTED]
>  says '
> Hello World !!
> '
> stop 10
> --- [Hello.Requester.11] State transition : VALID -> DESTROYING
> (Bundle #10) call deactivate
> --- [Hello.Requester.11] getting unbind: unbindHelloService
> --- [Hello.Requester.11] State transition : DESTROYING -> DESTROYED
> -> (Bundle #10) thread completed
> stop 8
> --- [Hello.Cmd] State transition : VALID -> DESTROYING
> --- [Hello.Cmd] unregistering the services
> (Bundle #8) call deactivate
> --- [Hello.Cmd] getting unbind: unbindHelloService
> --- [Hello.Cmd] State transition : DESTROYING -> DESTROYED
> -> stop 9
> --- [Hello.Service] State transition : VALID -> DESTROYING
> --- [Hello.Service] unregistering the services
> (Bundle #9) call deactivate
> --- [Hello.Service] State transition : DESTROYING -> DESTROYED
> ->

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to