Hi,
On 08/14/2013 03:08 PM, Farah Juma wrote:
However, for JCA, it doesn't seem like this will be possible
since the code that currently instantiates the JCAValidatorFactory doesn't have access
to the deploymentUnit (and it seems like there isn't a way to modify the code to be
able to access this). Another option might be to register the ValidatorFactory as a
service and then perform a manual lookup on the service.
Currently the BeanValidation integration is used to verify JCA 1.6+
based resource adapters, and passed into the deployment chain through
AbstractResourceAdapterDeploymentService::AbstractAS7RaDeployer::getBeanValidation()
so the deployment service name is available at that point. A resource
adapter can also look up a ValidatorFactory through JNDI at run-time -
there is no access through the JCA API.
Registering the ValidatorFactory as a service sounds like a solution to me.
Note, however, that resource adapter deployments doesn't support the CDI
model - at least vendor specific behavior. So investigating this would
be part of the JIRA.
I was wondering if anyone had any thoughts about what approach to
take for JCA or how to go about removing the JCAValidatorFactory. I've created
WFLY-1882 [3] to track this.
Thank you. If you have a working branch feel free to add it as a comment.
Best regards,
Jesper