[
https://issues.jboss.org/browse/CDI-45?page=com.atlassian.jira.plugin.sys...
]
John Ament commented on CDI-45:
-------------------------------
[~mkouba] I think the implication is that we want some of the features of {{Optional}}.
For example
{code}
MyBean bean = instance.select(MyBean.class).orElseThrow(() -> SomeException.class);
MyBean bean = instance.select(MyBean.class).orElse(someAlternate); //or supply
instance.select(MyBean.class).ifPresent(() -> someWork);
{code}
Optional Injection Points
-------------------------
Key: CDI-45
URL:
https://issues.jboss.org/browse/CDI-45
Project: CDI Specification Issues
Issue Type: Feature Request
Components: Resolution
Affects Versions: 1.0
Reporter: Stuart Douglas
Priority: Optional
Fix For: TBD
There are occoasions where it may be useful for some injection points to be optional,
e.g.
@Inject
@Optional
MyBean bean;
This would behave the same as a normal injection point, however it will not cause the
deployment to fail if it is not satisified.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)