"alesj" wrote : "adrian(a)jboss.org" wrote :
| | Neither of them work. See my comment about needing the className -> class HACK
| I see.
| What to do then?
| Adding another hack to existing hack? :-)
I think the closet you can get is:
1) Add the CLASS scope as we described above, but...
2) If bean.getClassLoader() == null add the real class to the CLASS scope level
using the deployment classloader to load the class
3) otherwise just use the class name.
Basically this means that if the bean is not using the deployment classloader
then unit.getMetaData() can't see the class annotations
(ClassMetaDataRetrievalFactory will return null for that metadata loader).
That seems like a fair restriction for this edge case and doesn't require
the HACK in the deployer's handling of scopes.
One change though is that it will be trying to load the bean class when it creates
the components. So it will be reporting an error in that earlier. You need to make
sure this error is understandable.
If you don't like this change, then you would have to introduce the HACK
to make it lazily load the class and update the scope key when getMetaData() is
View the original post :
Reply to the post :