* @exception SAXException if an error occurs while parsing the file
*/
protected void load(String sourceURL)
throws IOException, ProcessingException, SAXException {
Source source = null;
SourceResolver resolver = null;
try {
int valid = this.validity == null? SourceValidity.INVALID: this.validity.isValid();
if (valid != SourceValidity.VALID) {
// Saved validity is not valid, get new source and validity
resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
source = resolver.resolveURI(sourceURL);
SourceValidity sourceValidity = source.getValidity();
if (valid == SourceValidity.INVALID || this.validity.isValid(sourceValidity) != SourceValidity.VALID) {
HashMap values = new HashMap();
SourceUtil.toSAX(source, new SAXContentHandler(values));
this.validity = sourceValidity;
this.values = values;
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loaded XML bundle: " + this.name + ", locale: " + this.locale);
}
}
}
} catch (ServiceException e) {
throw new ProcessingException("Can't lookup source resolver", e);
} catch (MalformedURLException e) {
throw new SourceNotFoundException("Invalid resource URL: " + sourceURL, e);
} finally {
if (source != null) {
resolver.release(source);
}
this.manager.release(resolver);
}
}