*/
public ApplicationBean getApplication(final String appID) throws JahiaException {
checkIsLoaded();
ApplicationBean app = applicationCache.get(APPLICATION_DEFINITION + appID);
if (app == null) {
// try to load from db
try {
app = jcrTemplate.doExecuteWithSystemSession(new JCRCallback<ApplicationBean>() {
public ApplicationBean doInJCR(JCRSessionWrapper session) throws RepositoryException {
return fromNodeToBean(session.getNodeByUUID(appID));
}
});
} catch (RepositoryException e) {
logger.error(e.getMessage(), e);
}
if (app != null) {
applicationCache.put(APPLICATION_DEFINITION + appID, app);
applicationCache.put(APPLICATION_DEFINITION_CONTEXT + app.getContext(), app);
}
}
return app;
}