[cdi-dev] Question on BeanManager#createInstance()
mkouba at redhat.com
Mon Mar 27 02:34:47 EDT 2017
Dne 24.3.2017 v 22:19 Laird Nelson napsal(a):
> Hello; BeanManager#createInstance() says (in part):
> "Instances of dependent scoped beans obtained with this Instance must be
> explicitly destroyed by calling Instance.destroy(Object)."
> From the standpoint of the caller of, say,
> instance.select(MyBean.class), how is that caller supposed to know
> whether MyBean is in dependent scope or not?
The caller usually knows what bean it's working with.
> Is it anticipated that
> they will call BeanManager#getBeans() and investigate the Bean objects?
> Should Instance have a getScope() method on it, or the like?
There was a proposal to enhance Instance similarly as Weld API does:
But it was rejected/postponed. See also CDI-515, CDI-589, CDI-651 and
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
Senior Software Engineer
Red Hat, Czech Republic
More information about the cdi-dev