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 --




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Blueprint-prototype-scope-creates-unnecessary-bean-instances-Karaf-4-0-3-tp4044010.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to