use of com.qlangtech.tis.openapi.impl.SnapshotDomainGetter in project tis by qlangtech.
the class LoadSolrCoreConfigByAppNameServlet method getSnapshotDomain.
/**
* @param
* @param appKey
* @return
* @throws ServletException
*/
public static SnapshotDomain getSnapshotDomain(List<PropteryGetter> needRes, final AppKey appKey, RunContext runContext) throws ServletException {
SnapshotDomain snapshot = null;
snapshot = resourceCache.get(appKey.hashCode());
try {
if (!appKey.isFromCache() || snapshot == null) {
log.info("key relevant snapshot is null,key:" + appKey.toString());
synchronized (resourceCache) {
snapshot = resourceCache.get(appKey.hashCode());
if (!appKey.isFromCache() || snapshot == null) {
SnapshotDomainGetter snapshotDomainGetter = new SnapshotDomainGetter(runContext);
snapshot = snapshotDomainGetter.getSnapshot(appKey);
snapshot = getSnapshot(true, needRes, snapshot);
resourceCache.put(appKey.hashCode(), snapshot);
}
}
} else {
log.info("key relevant snapshot not null,key:" + appKey.toString());
}
} catch (SnapshotNotFindException e) {
throw new ServletException(e);
}
SnapshotDomain colon = getSnapshot(false, needRes, snapshot);
return colon;
}
Aggregations