java - Spring, load bean with specific dependency -
is possibile load bean (scope "prototype") telling spring create using specific dependency?
example:
- the dependencies, "storea" , "storeb"
- the bean want load, "service"
can tell spring load "service" "storea" , "storeb"?
actually solution i've found load 2 different application contexts each 1 common set of <include .../>
directives , specific 1 i've declared stores (so each application context has 1 declaration of store). can same thing using single application context?
you can refer specific beans using id, when autowiring use the
@qualifer("somebeanid")
or within spring context use 'ref'/'ref-local'
Comments
Post a Comment