You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2011/02/28 19:23:36 UTC

[jira] Created: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
--------------------------------------------------------------------------------------------------------------------------------------

                 Key: OWB-538
                 URL: https://issues.apache.org/jira/browse/OWB-538
             Project: OpenWebBeans
          Issue Type: New Feature
          Components: Injection and Lookup
    Affects Versions: 1.0.0
            Reporter: Mark Struberg
            Assignee: Mark Struberg
             Fix For: 1.1.0


The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
But this 

a) introduces many errors in projects
b) unnecessarily fills up our managed beans list 
c) causes lots of unnecessary work while scanning the classes.

Thus I'd like to propose the introduction of a non spec compliant flag 'onlyExplicitDependentScoped' which is false by default

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

        

[jira] Updated: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-538:
------------------------------

    Description: 
The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
But this 

a) introduces many errors in projects
b) unnecessarily fills up our managed beans list 
c) causes lots of unnecessary work while scanning the classes.

Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

  was:
The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
But this 

a) introduces many errors in projects
b) unnecessarily fills up our managed beans list 
c) causes lots of unnecessary work while scanning the classes.

Thus I'd like to propose the introduction of a non spec compliant flag 'onlyExplicitDependentScoped' which is false by default


> introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

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

        

[jira] Commented: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000493#comment-13000493 ] 

David Jencks commented on OWB-538:
----------------------------------

I think the real problem here is that owb currently loads every application class and creates metadata for almost all of them.  I think there may be a way to avoid this while not introducing any proprietary limitations or configuration.

We can easily find all the classes that are explicitly annotated or explicitly injected.  I think there's little doubt we should find these classes, load them, and create metadata for them on app startup.  However there are some dynamic ways of asking for web beans that cannot be detected through annotation scanning.  Can we arrange to create the metadata for these beans lazily when one of the dynamic methods is called?

BTW I don't recall any errors from the current "load everything" strategy.... what kinds of errors are you thinking of?

> introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

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

        

[jira] Commented: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000533#comment-13000533 ] 

Mark Struberg commented on OWB-538:
-----------------------------------

I now thought a bit longer about the lazyInit stuff. I almost started hacking it, but then I came across a few standard usecases which would be completely broken

* a not annotated 'auto dependent' bean would throw a DeploymentException only at runtime when it gets used the first time.
* a not annotated 'auto dependent' bean which contains a ProducerMethod would register this ProducerMethodBean at runtime, thus completely changing the behaviour of the whole container randomly

I fear lazy initialisation of beans is NOT possible!

> introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

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

        

[jira] Resolved: (OWB-538) lazy loading of not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved OWB-538.
-------------------------------

    Resolution: Fixed

> lazy loading of not explicitly marked (via annotation or registered by extension) Dependent beans
> -------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> beans which are not using any CDI annotations might get initiated lazily.

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

[jira] Commented: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "David Jencks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000586#comment-13000586 ] 

David Jencks commented on OWB-538:
----------------------------------

Maybe I've forgotten too much jcdi the last few weeks while working on other stuff, but I don't understand your usecases.

1. IIUC right now if we can't create metadata for a class, we don't, and ignore the failure.  If you then try to load such a web bean dynamically at runtime, won't you get the same exception?

2. Such a bean has a @ProducerMethod annotation, right?  So we'd find it and register the ProducerMethodBean at deploy time.

To perhaps try to be clearer.... I was thinking of looking for all annotations at deploy time and dealing with all of them (producer methods, fields, @Inject, etc etc etc) and only dealing with completely unannotated beans lazily.  (IIRC there's some @Alternative (???) annotation that can also pull in other unannotated sub- or super- classes.... these can be dealt with at deploy time also).

> introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

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

        

[jira] Commented: (OWB-538) introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000496#comment-13000496 ] 

Mark Struberg commented on OWB-538:
-----------------------------------

I was not talking about OWB errors, but application errors. E.g. if someone accidently uses a java.faces.beans.SessionScoped instead of the CDI @SessionScoped (with auto import in IDEs this happens pretty often), then the bean is effectively @Dependent and thus breaking the application logic in most cases. 
Also you will get an AmbiguousResolutionExceptions if you create a ProducerMethod for a POJO because there are 2 beans then: the ProducerMethodBean and the auto-pickup @Dependent Bean. Pretty annoying it is...

> introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

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

        

[jira] Updated: (OWB-538) lazy loading of not explicitly marked (via annotation or registered by extension) Dependent beans

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-538:
------------------------------

    Description: 
The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
But this 

a) introduces many errors in projects
b) unnecessarily fills up our managed beans list 
c) causes lots of unnecessary work while scanning the classes.

beans which are not using any CDI annotations might get initiated lazily.

  was:
The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
But this 

a) introduces many errors in projects
b) unnecessarily fills up our managed beans list 
c) causes lots of unnecessary work while scanning the classes.

Thus I'd like to propose the introduction of a non spec compliant flag 'useExplicitDependentScoped' which is false by default

        Summary: lazy loading of not explicitly marked (via annotation or registered by extension) Dependent beans  (was: introduce proprietary configuration option to ignore not explicitly marked (via annotation or registered by extension) Dependent beans)

> lazy loading of not explicitly marked (via annotation or registered by extension) Dependent beans
> -------------------------------------------------------------------------------------------------
>
>                 Key: OWB-538
>                 URL: https://issues.apache.org/jira/browse/OWB-538
>             Project: OpenWebBeans
>          Issue Type: New Feature
>          Components: Injection and Lookup
>    Affects Versions: 1.0.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.0
>
>
> The JSR-299 spec defines that not annotated beans must get picked up as being @Dependent by default.
> But this 
> a) introduces many errors in projects
> b) unnecessarily fills up our managed beans list 
> c) causes lots of unnecessary work while scanning the classes.
> beans which are not using any CDI annotations might get initiated lazily.

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