[seam-issues] [JBoss JIRA] Commented: (SOLDER-50) Throw a specialized exception when BeanManagerAware cannot resolve BeanManager

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri Dec 10 09:37:52 EST 2010


    [ https://issues.jboss.org/browse/SOLDER-50?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569258#comment-12569258 ] 

Dan Allen commented on SOLDER-50:
---------------------------------

We also need to reword because EE simply has missing areas of coverage for CDI. So for instance, w/o Seam Faces, people have no choice but to use BeanManagerAware/Accessor/Locator to do any sort of CDI tie-in.

The way I like to put it is "you should be using this to provide CDI integration, not spreading it all over application code. The goal is to shift into a managed environment so you can leverage the CDI programming model in a native way." 

> Throw a specialized exception when BeanManagerAware cannot resolve BeanManager
> ------------------------------------------------------------------------------
>
>                 Key: SOLDER-50
>                 URL: https://issues.jboss.org/browse/SOLDER-50
>             Project: Seam Solder
>          Issue Type: Feature Request
>          Components: Core
>            Reporter: Dan Allen
>            Assignee: Lincoln Baxter III
>            Priority: Minor
>
> The BeanManagerAware#getBeanManager() method currently throws an IllegalArgumentException when the BeanManager cannot be found by any provider. Because this exception is so generic, it's dangerous to bundle the lookup with other code because you aren't sure whether the IllegalArgumentException came from the BeanManager lookup or from a subsequent call, as in:
> try {
>    BeanManager beanManager = BeanManagerAccessor.getBeanManager();
>    beanManager.fireEvent(payload);
> }
> catch (IllegalArgumentException e) {
>    // what caused this?
> }
> Introduce a specialized checked exception for this unique failure. The proposed name is BeanManagerNotAvailable (or BeanManagerNotFound)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list