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 (Created) (JIRA)" <ji...@apache.org> on 2011/09/27 09:47:12 UTC

[jira] [Created] (OWB-619) @New beans must only exist if there is at least one injection point for them

@New beans must only exist if there is at least one injection point for them 
-----------------------------------------------------------------------------

                 Key: OWB-619
                 URL: https://issues.apache.org/jira/browse/OWB-619
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.1
            Reporter: Mark Struberg
            Assignee: Mark Struberg
             Fix For: 1.1.2


spec section 3.12 @New defines

>For each managed bean, and for each session bean, a second bean exists which ....
...
> is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.

Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: AW: [jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

Posted by Mark Struberg <st...@yahoo.de>.
Hi Arne!

Thinking about this too atm.

I also think having one Bean for parameterized types is enough. We don't alone get this information only in getBeans() but also via getReference, thus we can really store and pass this information down the invocation chain. Just thinking about all the details. Guess this needs some time to evolve in our heads ;)

LieGrue,
strub



----- Original Message -----
> From: Arne Limburg <ar...@openknowledge.de>
> To: "dev@openwebbeans.apache.org" <de...@openwebbeans.apache.org>
> Cc: 
> Sent: Tuesday, September 27, 2011 12:38 PM
> Subject: AW: [jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them
> 
> Hi Mark,
> 
> Where do you want to add the NewBean instances in the code?
> I wonder if NewBeans should be threated same as the InstanceBeans, EventBeans 
> and InjectionPointBeans that we are recently discussing.
> 
> Imho all these beans need special treatment.
> If we would take the spec literally we would have to
> - Create an InstanceBean for every legal bean-type
> - Create a NewBean for each managed bean and for each session bean (however it 
> would be disabled if no InjectionPoint exists)
> - Create an EventBean for every Java-type that does not contain a type variable 
> and for every qualifier type in its set of qualifier types
> - Create one InjectionPointBean
> 
> However, if we would add all such beans, it would consume far too much memory. 
> Having just one bean of each type (like we have currently for InstanceBean, 
> EventBean and InjectionPointBean) is not enough, since we need additional 
> information in this ugly and buggy ThreadLocal. Btw. the NewBean could have been 
> implemented the same way, but was not.
> 
> So if we don't want to create every bean that is needed by the spec on 
> container-startup, we have to create them later. And this should take place at 
> one certain point in code.
> This point in code is imho the Injection-Resolver since it already caches the 
> beans and we would not create one and the same bean twice. WDYT?
> 
> Or am I completely wrong and we should tread all this beans separately?
> 
> Cheers,
> Arne
> 
> --
> 
> Arne Limburg - Enterprise Architekt
> open knowledge GmbH, Oldenburg
> Bismarckstraße 13, 26122 Oldenburg
> Mobil: +49 (0) 151 108 22 942
> Tel: +49 (0) 441 - 4082-0
> Fax: +49 (0) 441 - 4082-111
> arne.limburg@openknowledge.de
> http://www.openknowledge.de 
> 
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Mark Struberg (Commented) (JIRA) [mailto:jira@apache.org] 
> Gesendet: Dienstag, 27. September 2011 11:54
> An: dev@openwebbeans.apache.org
> Betreff: [jira] [Commented] (OWB-619) @New beans must only exist if there is at 
> least one injection point for them
> 
> 
>     [ 
> https://issues.apache.org/jira/browse/OWB-619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115370#comment-13115370 
> ] 
> 
> Mark Struberg commented on OWB-619:
> -----------------------------------
> 
> I agree that it's not very user friendly, but honestly: did you ever use 
> @New ? ;) It's practically irrelevant, because it is only intended for the 
> @Inject @New(MyClass.class) use case. There is no dynamic nor whatever lookup 
> allowed by the spec atm. You cannot even trigger producer methods or fields with 
> it...
>                 
>>  @New beans must only exist if there is at least one injection point 
>>  for them
>>  ----------------------------------------------------------------------
>>  -------
>> 
>>                  Key: OWB-619
>>                  URL: https://issues.apache.org/jira/browse/OWB-619 
>>              Project: OpenWebBeans
>>           Issue Type: Bug
>>           Components: Core
>>     Affects Versions: 1.1.1
>>             Reporter: Mark Struberg
>>             Assignee: Mark Struberg
>>              Fix For: 1.1.2
>> 
>> 
>>  spec section 3.12 @New defines
>>  >For each managed bean, and for each session bean, a second bean exists 
> which ....
>>  ...
>>  > is enabled, in the sense of Section 5.1.2, "Enabled and disabled 
> beans", if and only if some other enabled bean has an injection point with 
> the qualifier @New(X.class) where X is the bean class.
>>  Which means that we dont need to create a NewBean for each and every bean, 
> but only for ones which gets used in an InjectionPoint somewhere!
>>  This can massively reduce the amount of needed beans and the mem 
>>  consumption of OWB
> 
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: 
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa 
> For more information on JIRA, see: http://www.atlassian.com/software/jira 
>

AW: [jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

Posted by Arne Limburg <ar...@openknowledge.de>.
Hi Mark,

Where do you want to add the NewBean instances in the code?
I wonder if NewBeans should be threated same as the InstanceBeans, EventBeans and InjectionPointBeans that we are recently discussing.

Imho all these beans need special treatment.
If we would take the spec literally we would have to
- Create an InstanceBean for every legal bean-type
- Create a NewBean for each managed bean and for each session bean (however it would be disabled if no InjectionPoint exists)
- Create an EventBean for every Java-type that does not contain a type variable and for every qualifier type in its set of qualifier types
- Create one InjectionPointBean

However, if we would add all such beans, it would consume far too much memory. Having just one bean of each type (like we have currently for InstanceBean, EventBean and InjectionPointBean) is not enough, since we need additional information in this ugly and buggy ThreadLocal. Btw. the NewBean could have been implemented the same way, but was not.

So if we don't want to create every bean that is needed by the spec on container-startup, we have to create them later. And this should take place at one certain point in code.
This point in code is imho the Injection-Resolver since it already caches the beans and we would not create one and the same bean twice. WDYT?

Or am I completely wrong and we should tread all this beans separately?

Cheers,
Arne

--
 
Arne Limburg - Enterprise Architekt
open knowledge GmbH, Oldenburg
Bismarckstraße 13, 26122 Oldenburg
Mobil: +49 (0) 151 108 22 942
Tel: +49 (0) 441 - 4082-0
Fax: +49 (0) 441 - 4082-111
arne.limburg@openknowledge.de
http://www.openknowledge.de

Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann


-----Ursprüngliche Nachricht-----
Von: Mark Struberg (Commented) (JIRA) [mailto:jira@apache.org] 
Gesendet: Dienstag, 27. September 2011 11:54
An: dev@openwebbeans.apache.org
Betreff: [jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them


    [ https://issues.apache.org/jira/browse/OWB-619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115370#comment-13115370 ] 

Mark Struberg commented on OWB-619:
-----------------------------------

I agree that it's not very user friendly, but honestly: did you ever use @New ? ;) It's practically irrelevant, because it is only intended for the @Inject @New(MyClass.class) use case. There is no dynamic nor whatever lookup allowed by the spec atm. You cannot even trigger producer methods or fields with it...
                
> @New beans must only exist if there is at least one injection point 
> for them
> ----------------------------------------------------------------------
> -------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem 
> consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Mark Struberg resolved OWB-619.
-------------------------------

    Resolution: Fixed

Talked with other EG folks. We really only need to/must create a @NewBean if it is used in an injectionpoint, but _not_ for each and every bean around.

Our internal mem consumption dropped drastically since we only need to store half the number of Beans now...
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Mark Struberg commented on OWB-619:
-----------------------------------

Actually Bean<T> nor Contextual<T> have any isEnabled(). Thus I guess what is meant by the spec is that they are just not available in the BeanManager.

See 11.1. The Bean interface
> An instance of Bean exists for every enabled bean.

                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Mark Struberg commented on OWB-619:
-----------------------------------

Hmm, it changes the behaviour of course. But it would then be spec conform, so I'd rather say it would 'fix' the code rather than break it :D
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Mark Struberg commented on OWB-619:
-----------------------------------

thats exactly what I asked jboss folks too. Weld is doing the same. In fact, they just added this section pretty late because they had performance problems. Doing a getBeans(Bla.class, newLiteral) is not permitted if Bla doesnt get used at an injection point! This is how the RI behaves too.
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Mark Struberg commented on OWB-619:
-----------------------------------

I agree that it's not very user friendly, but honestly: did you ever use @New ? ;)
It's practically irrelevant, because it is only intended for the @Inject @New(MyClass.class) use case. There is no dynamic nor whatever lookup allowed by the spec atm. You cannot even trigger producer methods or fields with it...
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

The spec says that this bean exists, so it should be returned by BeanManager.getBeans(...)
However if no injection point exists, it is not active so it should be filtered out by BeanManager.resolve(...)
So imho the creation of such bean does not depend on the existence of an injection point.
Just the result of BeanManager.resolve(...) does.
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

I am perfectly fine with not creating a NewBean for every managed Bean. Let's discuss the implementation details on the dev-list
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

I just wanted to point out that your suggested change may break existing code.
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

Section 5.1.2 talk about enabled and disabled beans. All the disabled beans it talks about are available via BeanManager.getBeans(...)
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

>From reading the spec you are right. But I am wondering, if this change would break existing code, since @New is a qualifier, it could be used in BeanManager.getBeans or Instance.select... which would change behavior (i.e. not return any bean) then.

Should we add a special handling for the @New qualifier in the injection resolver, too?
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OWB-619) @New beans must only exist if there is at least one injection point for them

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

Arne Limburg commented on OWB-619:
----------------------------------

This is another point where the specified behavior is not obvious to the user. This means, that a user cannot predict, if getBeans(Bla.class, newLiteral) will work or not, since at that point he/she cannot know if there exists such injection point.

Dynamic creation of that bean would be the better solution here, imho. But I guess I have to raise a spec issue for this. At least it should be specified that the @New literal is forbitten in general as parameter for getBeans(...)
                
> @New beans must only exist if there is at least one injection point for them 
> -----------------------------------------------------------------------------
>
>                 Key: OWB-619
>                 URL: https://issues.apache.org/jira/browse/OWB-619
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>
> spec section 3.12 @New defines
> >For each managed bean, and for each session bean, a second bean exists which ....
> ...
> > is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier @New(X.class) where X is the bean class.
> Which means that we dont need to create a NewBean for each and every bean, but only for ones which gets used in an InjectionPoint somewhere!
> This can massively reduce the amount of needed beans and the mem consumption of OWB

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira