[hibernate-issues] [Hibernate-JIRA] Commented: (HV-570) Provide an hibernate validator OSGI service exporter

Gunnar Morling (JIRA) noreply at atlassian.com
Fri Apr 13 04:27:50 EDT 2012


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

Gunnar Morling commented on HV-570:
-----------------------------------

I've spoken to a friend of mine who knows the ins and outs of OSGi. He recommended that we export the services programmatically using the service activator of our bundle. That's not as elegant but it's the approach with highest portability (the infrastructure for DS/Blueprint Services might not be provided/enabled in every case).

{quote}
What's about custom message interpolator, traversable resolver, etc. Basically everything you can configure in validation.xml?
{quote}

I think the default {{Validator}} and {{ValidatorFactory}} exposed as OSGi service should be configured based on {{validation.xml}}, similar to the default validator (factory) in JEE/CDI. If a user wants to expose a specifically configured validator or factory, I think she could do this and upon service retrieval she could select the right service by specifying a filter (AFAICS that's roughly equivalent to CDI qualifiers).

{quote}
I am thinking about multiple BV implementation all exporting the ValidatorFactory - how would I select between them?
{quote}

This could also done by using a filter, alternatively there is the concept of "ranking", which specifies an order between several implementations. As fallback the order of service registration is used.

> Provide an hibernate validator OSGI service exporter
> ----------------------------------------------------
>
>                 Key: HV-570
>                 URL: https://hibernate.onjira.com/browse/HV-570
>             Project: Hibernate Validator
>          Issue Type: New Feature
>          Components: engine
>    Affects Versions: 4.3.0.Alpha1
>            Reporter: Charlie Mordant
>            Priority: Minor
>
> Hi,
> I've created a hibernate validator OSGI service exporter.
> Feel free to use it, publish it on central (it will be cool), modify...
> You can find it in my github: https://github.com/Tcharl/org.hibernate.validation.osgi.service/
> Regards,

--
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