[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Generated Classes not found if they do not match any of

adrian@jboss.org do-not-reply at jboss.com
Mon Jan 26 12:41:52 EST 2009


"kabir.khan at jboss.com" wrote : I can generate the proxies in org.jboss.aop.generatedproxies package in the user's classloader.
  | 
  | Can you guys make the necessary changes to jboss-cl/AS deployers for this to work? Or let me know where to fix this.

Hold your horses. :-)

You haven't answered why it is defined against the user classloader?
See my point about classloader leaks.

Having every classloader export that package will make the classloader 
search in that package slow. It will need to check every classloader.
Of course once it has done it once, the result will be cached
(at least until somebody deploys/undeploys a classloader).

We also haven't discussed your other point about needing to flush the blacklist.

START OF IMPLEMENTATION DISCUSSION

Anyway, there's a number of ways to do it. It really depends upon how much you
want to make this configurable, i.e. allow different configuration per classloader ,etc.
and how you want to use it.

The simplest mechanism would be to add an "always exported packages"
to the ClassLoading bean. Then in Module.getCapabilities() you add
those package capabilities to what the modules decides by the Module itself
or are generated by the "defaultCapabilities".

But this could be generalized to "global capabilities' rather than
"always exported packages" such that the Classloading bean could be configured
with packages that have a version if that is important?

e.g.

  | <bean name="ClassLoading">
  |    <property name="GlobalCapabilities">
  |         <capabilities xmlns="urn:jboss:classloading:1.0">
  |              <package name="org.jboss.aop.generatedclasses" version="2.0.0"/>
  |         </capabilities>
  |    </property>
  | </bean>
  | 

I'm not sure how useful this really is as a generalization? :-)

It also introduces complications:
1) if you somebody makes the mistake of adding a module capability that is global
then all modules would get the same module name as an alias :-)
2) Do we try to merge the global capabilities with what the classloader defines?
e.g. we ignore the global capability if the classloader defines version 2.0.1 of the same package?
etc.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204780#4204780

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204780



More information about the jboss-dev-forums mailing list