You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by David Blevins <da...@gmail.com> on 2015/10/25 06:49:56 UTC

Custom Scope mystery

Intended to implement several custom scopes for JavaOne to show people how.  5 hours later I can’t seem to get much joy.

We have a test for it, but sadly it appears to not do what we hope:

 - https://github.com/dblevins/openwebbeans/commit/d0b1beda01e4ed3e8924b058b987b9f7ad96391d

Completely gutted ExternalTestScopeContext but sadly all tests in webbeans-impl still pass.


Went back several versions 1.2.2, 1.1.8, etc.  Sadly same behavior on all of them.

What’s the deal?

(fyi, presentation is Tuesday)

-- 
David Blevins
http://twitter.com/dblevins
http://www.tomitribe.com


Re: Custom Scope mystery

Posted by Mark Struberg <st...@yahoo.de>.
will take a look.

LieGrue,
staub

> Am 25.10.2015 um 06:49 schrieb David Blevins <da...@gmail.com>:
> 
> Intended to implement several custom scopes for JavaOne to show people how.  5 hours later I can’t seem to get much joy.
> 
> We have a test for it, but sadly it appears to not do what we hope:
> 
> - https://github.com/dblevins/openwebbeans/commit/d0b1beda01e4ed3e8924b058b987b9f7ad96391d
> 
> Completely gutted ExternalTestScopeContext but sadly all tests in webbeans-impl still pass.
> 
> 
> Went back several versions 1.2.2, 1.1.8, etc.  Sadly same behavior on all of them.
> 
> What’s the deal?
> 
> (fyi, presentation is Tuesday)
> 
> -- 
> David Blevins
> http://twitter.com/dblevins
> http://www.tomitribe.com
> 


Re: Custom Scope mystery

Posted by David Blevins <da...@gmail.com>.
Issue is, we need to write a better test case :)

We install the context, but since it is NormalScope and not dependent scoped, the instance resolution does not take place until the proxy is invoked (not when injected).

The test doesn’t invoke the instance, it only looks it up from the bean manager, therefore the custom scope is *never* used.

Don’t have time to improve the testcase, but perfect afternoon of hacking for someone else to enjoy :)


-- 
David Blevins
http://twitter.com/dblevins
http://www.tomitribe.com

> On Oct 24, 2015, at 10:49 PM, David Blevins <da...@gmail.com> wrote:
> 
> Intended to implement several custom scopes for JavaOne to show people how.  5 hours later I can’t seem to get much joy.
> 
> We have a test for it, but sadly it appears to not do what we hope:
> 
> - https://github.com/dblevins/openwebbeans/commit/d0b1beda01e4ed3e8924b058b987b9f7ad96391d
> 
> Completely gutted ExternalTestScopeContext but sadly all tests in webbeans-impl still pass.
> 
> 
> Went back several versions 1.2.2, 1.1.8, etc.  Sadly same behavior on all of them.
> 
> What’s the deal?
> 
> (fyi, presentation is Tuesday)
> 
> -- 
> David Blevins
> http://twitter.com/dblevins
> http://www.tomitribe.com
>