//! Bug this is being run more then once!
long howOldItWas = 0; // Initialize to avoid warnings
ResourceLoader resourceLoader = null;
for (int i = 0; i < resourceLoaders.size(); i++)
{
resourceLoader = (ResourceLoader) resourceLoaders.get(i);
resource.setResourceLoader(resourceLoader);
/*
* catch the ResourceNotFound exception
* as that is ok in our new multi-loader environment
*/
try
{
if (resource.process())
{
/*
* FIXME (gmj)
* moved in here - technically still
* a problem - but the resource needs to be
* processed before the loader can figure
* it out due to to the new
* multi-path support - will revisit and fix
*/
Runtime.info("ResourceManager : found " + resourceName +
" with loader " + resourceLoader.getClassName());
howOldItWas = resourceLoader.getLastModified( resource );
break;
}
}
catch( ResourceNotFoundException rnfe )
{
/*
* that's ok - it's possible to fail in
* multi-loader environment
*/
}
}
/*
* Return null if we can't find a resource.
*/
if (resource.getData() == null)
{
throw new ResourceNotFoundException(
"Unable to find resource '" + resourceName + "'");
}
resource.setLastModified( howOldItWas );
resource.setModificationCheckInterval(
resourceLoader.getModificationCheckInterval());
resource.touch();
/*
* Place the resource in the cache if the resource
* loader says to.
*/
if (resourceLoader.isCachingOn())
{
globalCache.put(resourceName, resource);
}
}
catch( ResourceNotFoundException rnfe2 )