throws Exception {
final String id = source.getURI();
ProgrammingLanguage programmingLanguage = null;
MarkupLanguage markupLanguage = null;
try {
// Create file name for the program generated from the provided source.
final String normalizedName = getNormalizedName(id);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Loading serverpage systemId=[" + id + "]" +
" markupLanguageName=[" + markupLanguageName + "]" +
" programmingLanguageName=[" + programmingLanguageName + "]" +
" -> normalizedName=[" + normalizedName + "]");
}
markupLanguage = (MarkupLanguage) this.markupSelector.select(markupLanguageName);
programmingLanguage = (ProgrammingLanguage) this.languageSelector.select(programmingLanguageName);
programmingLanguage.setLanguageName(programmingLanguageName);
Program program = null;
CompiledComponent programInstance = null;
// Attempt to load program object from cache
try {
programInstance = (CompiledComponent) this.cache.select(normalizedName);
} catch (Exception e) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("The serverpage [" + id + "] is not in the cache yet");
}
}
if (programInstance == null && this.preload) {
// Preloading: Load program if its source/[object file] is available
try {
program = programmingLanguage.preload(normalizedName,
this.workDir,
markupLanguage.getEncoding());
this.cache.addGenerator(newManager, normalizedName, program);
programInstance = (CompiledComponent) this.cache.select(normalizedName);
if (getLogger().isDebugEnabled()) {