class ResourceStoreManager {
/**
* Load a resource, or get one from the cache.
* @param identifier The resource identifier.
* @return A Resource instance, or <strong>null</strong> if the resource
* doesn't exist in that storeEntry.
* @exception InvalidResourceException If the resource couldn't be
* restored from its pickled format.
*/
synchronized ResourceReference loadResource(String name, Hashtable defs) {
ResourceReference rr = lookupResource(name);
if (rr != null)
return rr;
rr = new Reference(this, name, defs);
try {
Resource res = rr.lock();
if (res == null)
return null;
} catch (InvalidResourceException ex) {
return null;
} finally {
rr.unlock();
}
references.put(name, rr);
return rr;
}
}