[hibernate-issues] [Hibernate-JIRA] Commented: (HV-582) Introduce a class loading service

Gunnar Morling (JIRA) noreply at atlassian.com
Sun May 13 13:29:11 EDT 2012


    [ https://hibernate.onjira.com/browse/HV-582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46641#comment-46641 ] 

Gunnar Morling commented on HV-582:
-----------------------------------

I had a look where the {{LoadClass}} and {{GetClassLoader}} privileged actions are used. Based on that, I think it's safe to say that the XML descriptors are the main driver for such a service. There we're loading several things dynamically and would benefit from a clearly defined class loader service. Also discovery of the descriptors themselves would probably be a use case. 

Other usages of the privileged actions include checking whether JPA is around and the creation of annotation proxies in the programmatic API (for given constraint definitions). Another candidate might be {{PlatformResourceBundleLocator}} where we are looking for resource bundles.

> Introduce a class loading service
> ---------------------------------
>
>                 Key: HV-582
>                 URL: https://hibernate.onjira.com/browse/HV-582
>             Project: Hibernate Validator
>          Issue Type: New Feature
>          Components: engine
>    Affects Versions: 4.3.0.CR1
>            Reporter: Hardy Ferentschik
>              Labels: class, loading
>             Fix For: 5.x
>
>
> Currently all class loading in HV happens vi the _LoadClass_ _PrivilegedAction_. In the implementation we first check the thread context class loader and then the current class loader (unless we are loading own package classes in which case we use the current class loader). Historically that was a good approach, but in order to allow for customization in all sorts of environments it makes sense to have a way to configure the class loading approach. This could be done via a _ClassLoaderService_ which can for example be set via the _Configuration_. 
> Depending on which way Bean Validation goes this could be a HV specific feature or something defined by the spec.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list