You already have the preferred solution in BundleActivatorDeployer.
i.e. inject it into your deployer.
But, I don't really see a problem with getting it via attachments though
as long as you are not wanting to create a BundleContext on a deployment
that is undeployed/errored (it won't the attachment).
Holding references to all those instance objects doesn't look correct to me
when you can get them "on the fly". You're just increasing the memory
footprint of the class and adding more references for the GC to track.
It's not like its so much work to invoke a getter that it needs caching. ;-)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133799#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...