You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2019/12/11 17:33:59 UTC

package scoped methods and proxy in a custom classloaders

Hi all,

In Aries-CDI we have the issue that package scope methods are not working
because we used the classloader defining strategy - in OSGi we don't have
much choices with the extender pattern.

I'd like to go one step further and ensure it works - since it seems
working for weld.

I started a patch in a PoC mode -
https://gist.github.com/rmannibucau/6063d64231b0c432a43169a87507a47f - but
I hit an issue:

1. I can call a package scope method on a bean using reflection
2. I can't call a package scope method when in a bean injected in another
bean (there is a test in the gist to illustrate it)

Long story short the bytecode wired the method call to the package scope
method and the JVM does not have inheritance here so skips the proxy call.

However, we know when we create a proxy if the method call is a proxy so we
should be able to reroute it in the proxy - with the several layers of
proxy we can get :s.

My question is: do you see a simpler and more elegant way to solve that
issue?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>