[
https://hibernate.onjira.com/browse/BVAL-286?page=com.atlassian.jira.plug...
]
Hardy Ferentschik updated BVAL-286:
-----------------------------------
Description:
At several occasions Bean Validation needs to do some class loading or at least needs a
class loader
(e.g. loading classes specified in the xml configuration, detecting whether JPA is on the
classpath in the case
of TraversableResolver, loading resource bundles).
The spec does not define which class loader should be used in these cases. Hibernate
Validator for example
first tries the context and then the current class loader. The behavior should be
specified and made configurable, eg via a
_ClassLoaderService_:
{code}
public interface ClassLoaderService {
<T> Class<T> classForName(String className);
ResourceBundle loadBundle(String bundleName, Locale locale);
// potentially more class loader related methods
...
}
{code}
An implementation of such a service could be passed if we add
_javax.validation.Configuration#classLoaderService(ClassLoaderService)_
Having such a service would also be beneficial for integration of Bean Validation into
container/OSGi environments.
was:
At several occasions Bean Validation needs to do some class loading or at least needs a
class loader
(e.g. loading classes specified in the xml configuration, detecting whether JPA is on the
classpath in the case
of TraversableResolver, loading resource bundles).
The spec does not define which class loader should be used in these cases. Hibernate
Validator for example
first tries the context and then the current class loader. The behavior should be
specified and made configurable, eg via a
_ClassLoaderService_:
{code}
public interface ClassLoaderService {
public <T> Class<T> classForName(String className);
// potentially more class loader related methods
...
}
{code}
An implementation of such a service could be passed if we add
_javax.validation.Configuration#classLoaderService(ClassLoaderService)_
Having such a service would also be beneficial for integration of Bean Validation into
container/OSGi environments.
Introduce a ClassLoadingService to be configured via the
Configuration instance
-------------------------------------------------------------------------------
Key: BVAL-286
URL:
https://hibernate.onjira.com/browse/BVAL-286
Project: Bean Validation
Issue Type: New Feature
Components: spec-general
Affects Versions: 1.1.0.Alpha1 (early draft 1)
Reporter: Hardy Ferentschik
Fix For: 1.1.next
At several occasions Bean Validation needs to do some class loading or at least needs a
class loader
(e.g. loading classes specified in the xml configuration, detecting whether JPA is on the
classpath in the case
of TraversableResolver, loading resource bundles).
The spec does not define which class loader should be used in these cases. Hibernate
Validator for example
first tries the context and then the current class loader. The behavior should be
specified and made configurable, eg via a
_ClassLoaderService_:
{code}
public interface ClassLoaderService {
<T> Class<T> classForName(String className);
ResourceBundle loadBundle(String bundleName, Locale locale);
// potentially more class loader related methods
...
}
{code}
An implementation of such a service could be passed if we add
_javax.validation.Configuration#classLoaderService(ClassLoaderService)_
Having such a service would also be beneficial for integration of Bean Validation into
container/OSGi environments.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira