if (bValRequired) {
// fatal error - ValidationMode requires a validator
Message msg = _loc.get("vlem-creation-error");
log.error(msg, e);
// rethrow as a more descriptive/identifiable exception
throw new ValidationUnavailableException(
msg.getMessage(),
new RuntimeException(e), true);
} else {
// no optional validation provider, so just trace output
if (log.isTraceEnabled()) {
log.trace(_loc.get("vlem-creation-warn",
"No available javax.validation APIs"));
}
return brc;
}
}
// we have the javax.validation APIs
try {
// try loading a validation provider
ValidatorImpl validator = new ValidatorImpl(conf);
// set the Validator into the config
conf.setValidatorInstance(validator);
// update the LifecycleEventManager plugin to use it
conf.setLifecycleEventManager("validating");
// all done, so return good rc if anyone cares
brc = true;
} catch (RuntimeException e) {
if (bValRequired) {
// fatal error - ValidationMode requires a validator
// rethrow as a WrappedException
Message msg = _loc.get("vlem-creation-error");
log.error(msg, e);
// rethrow as a more descriptive/identifiable exception
throw new ValidationUnavailableException(
msg.getMessage(),
e, true);
} else {
// unexpected, but validation is optional,