You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Viktor Kozlov (JIRA)" <ji...@apache.org> on 2015/12/04 10:13:10 UTC

[jira] [Updated] (KARAF-4169) Blueprint creates unnecessary prototype bean instances

     [ https://issues.apache.org/jira/browse/KARAF-4169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Viktor Kozlov updated KARAF-4169:
---------------------------------
    Description: 
After creating all necessary prototype instances, blueprint create one more instance for each prototype bean. It can be a huge trouble when there is deep prototype bean tree.

Here is simple example to demonstrate it: http://www.lorien.biz/karaf/test.zip

-- normal creation --
Server1 create bpt.test.internal.Server1@67ea2a02
Server2 create bpt.test.internal.Server2@72af85f3
Consumer1 create bpt.test.internal.Consumer1@35fc15f7
injected_s1 bpt.test.internal.Server1@67ea2a02
injected_s2 bpt.test.internal.Server2@72af85f3
MyServlet create bpt.test.internal.MyServlet@612307e7
injected_c bpt.test.internal.Consumer1@35fc15f7
-- normal creation ends --
-- unnecessary creation of Server 1 --
Server1 create bpt.test.internal.Server1@6f878ffd
-- unnecessary creation of Server 1 ends --
-- unnecessary creation of Server 2 --
Server2 create bpt.test.internal.Server2@2cfe643f
-- unnecessary creation of Server 2 ends --
-- unnecessary creation of Consumer (with its all dependencies which are prototypes too) --
Server1 create bpt.test.internal.Server1@71677b2c
Server2 create bpt.test.internal.Server2@40c7bfde
Consumer1 create bpt.test.internal.Consumer1@7a05a90b
injected_s1 bpt.test.internal.Server1@71677b2c
injected_s2 bpt.test.internal.Server2@40c7bfde
-- unnecessary creation of Consumer ends -- 

  was:
After creating all necessary prototype instances, blueprint create one more instance for each prototype bean. It can be a huge trouble when there is deep prototype bean tree.

Here is simple example to demostrate it: http://www.lorien.biz/karaf/test.zip

-- normal creation --
Server1 create bpt.test.internal.Server1@67ea2a02
Server2 create bpt.test.internal.Server2@72af85f3
Consumer1 create bpt.test.internal.Consumer1@35fc15f7
injected_s1 bpt.test.internal.Server1@67ea2a02
injected_s2 bpt.test.internal.Server2@72af85f3
MyServlet create bpt.test.internal.MyServlet@612307e7
injected_c bpt.test.internal.Consumer1@35fc15f7
-- normal creation ends --
-- unnecessary creation of Server 1 --
Server1 create bpt.test.internal.Server1@6f878ffd
-- unnecessary creation of Server 1 ends --
-- unnecessary creation of Server 2 --
Server2 create bpt.test.internal.Server2@2cfe643f
-- unnecessary creation of Server 2 ends --
-- unnecessary creation of Consumer (with its all dependencies which are prototypes too) --
Server1 create bpt.test.internal.Server1@71677b2c
Server2 create bpt.test.internal.Server2@40c7bfde
Consumer1 create bpt.test.internal.Consumer1@7a05a90b
injected_s1 bpt.test.internal.Server1@71677b2c
injected_s2 bpt.test.internal.Server2@40c7bfde
-- unnecessary creation of Consumer ends -- 


> Blueprint creates unnecessary prototype bean instances
> ------------------------------------------------------
>
>                 Key: KARAF-4169
>                 URL: https://issues.apache.org/jira/browse/KARAF-4169
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 4.0.3
>         Environment: Windows 7 version 6.1 x64
> Java 1.7.0_80 x64
>            Reporter: Viktor Kozlov
>
> After creating all necessary prototype instances, blueprint create one more instance for each prototype bean. It can be a huge trouble when there is deep prototype bean tree.
> Here is simple example to demonstrate it: http://www.lorien.biz/karaf/test.zip
> -- normal creation --
> Server1 create bpt.test.internal.Server1@67ea2a02
> Server2 create bpt.test.internal.Server2@72af85f3
> Consumer1 create bpt.test.internal.Consumer1@35fc15f7
> injected_s1 bpt.test.internal.Server1@67ea2a02
> injected_s2 bpt.test.internal.Server2@72af85f3
> MyServlet create bpt.test.internal.MyServlet@612307e7
> injected_c bpt.test.internal.Consumer1@35fc15f7
> -- normal creation ends --
> -- unnecessary creation of Server 1 --
> Server1 create bpt.test.internal.Server1@6f878ffd
> -- unnecessary creation of Server 1 ends --
> -- unnecessary creation of Server 2 --
> Server2 create bpt.test.internal.Server2@2cfe643f
> -- unnecessary creation of Server 2 ends --
> -- unnecessary creation of Consumer (with its all dependencies which are prototypes too) --
> Server1 create bpt.test.internal.Server1@71677b2c
> Server2 create bpt.test.internal.Server2@40c7bfde
> Consumer1 create bpt.test.internal.Consumer1@7a05a90b
> injected_s1 bpt.test.internal.Server1@71677b2c
> injected_s2 bpt.test.internal.Server2@40c7bfde
> -- unnecessary creation of Consumer ends -- 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)