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

Gunnar Morling (JIRA) noreply at atlassian.com
Sun May 13 03:10:09 EDT 2012


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

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

So am I :)

I've continued with my [BVAL-251|https://github.com/gunnarmorling/hibernate-validator/tree/BVAL-251] branch a bit and I'm experimenting right now with the option of passing a class loader into the library.

So far I thought the BV or HV bundle could register the default validator and factory as OSGi services upon bundle start up. But to load types from the validation XML descriptors, the correct class loader must already have been set. So I guess an application bundle itself needs to create the validator factory (using the correct class loader) and register that one with the OSGi service registry.

> 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