[jboss-jira] [JBoss JIRA] Reopened: (JBJMX-109) loaderRepositoryClass="..." seems to be useless

Ondrej Žižka (JIRA) jira-events at lists.jboss.org
Thu Jul 8 20:16:46 EDT 2010


     [ https://jira.jboss.org/browse/JBJMX-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ondrej Žižka reopened JBJMX-109:
--------------------------------



loaderRepositoryClass is still in the DTD. We should check it's status.
http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd

> loaderRepositoryClass="..." seems to be useless
> -----------------------------------------------
>
>                 Key: JBJMX-109
>                 URL: https://jira.jboss.org/browse/JBJMX-109
>             Project: JBoss JMX
>          Issue Type: Feature Request
>    Affects Versions: JBossAS-4.0.0
>            Reporter: David Schlotfeldt
>
> This isn't exactly an error, and maybe we just aren't suppose to use it, but DTD and documentation says we can specify an implementation of org.jboss.mx.loading.LoaderRepository to use in many xml files, such as jboss-app.xml, with the loaderRepositoryClass attribute.
> Well even though you can -- you can't. You can't because a number of classes including UnifiedClassLoader cast objects directly to UnifiedLoaderRepository3 instead of LoaderRepository. Which means your implementations actually need to extend UnifiedLoaderRepository3.
> Also HeirarchicalLoaderRepository3 is not flexible. You would think it would be possible to create a hierarchy of LoaderRepositorys but you can't. This is because it expects its parent to be a UnifiedLoaderRepository3 -- okay fine, whatever. So you should at least be able a HeirarchicalLoaderRepository3   object as a parent to another HeirarchicalLoaderRepository3  object since UnifiedLoaderRepository3 extends UnifiedLoaderRepository3. You can't . Why? Well because I am PRETTY SURE that HeirarchicalLoaderRepository3.getPackageClassLoaders(..) returns a Set of PkgClassLoader objects while UnifiedLoaderRepository3 .getPackageClassLoaders(..)  (the method it overrides!) returns a Set of RepositoryClassLoader objects.   When HeirarchicalLoaderRepository3 calls getPackageClassLoaders(...) on its parent repository it casts items to RepositoryClassLoader , since that is what UnifiedLoaderRepository3 returns. This means if you make HeirarchicalLoaderRepository3 have a parent of type HeirarchicalLoaderRepository3  you will get a ClassCastException since.. well.. a PkgClassLoader  isn't a RepositoryClassLoader  class.
> LoadMgr3 is actually programmed to expect the Set returned by getPackageClassLoaders(...) to be both RepositoryClassLoader  and PkgClassLoader objects probably because of this.
> I COMPLETELY understand how code gets messy through time but this code should really be cleaned up -- especially if we are allowing users to specify a LoaderRepository implementation. As it stands the loaderRepositoryClass attribute SEEMS to be useless to specify your own implementation.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jboss-jira mailing list