use of cn.edu.zju.acm.onlinejudge.persistence.ContestPersistence in project zoj by licheng.
the class ContestManager method getContests.
public List<AbstractContest> getContests(int contestType) throws PersistenceException {
Object key = new Integer(contestType);
synchronized (this.contestsCache) {
List<AbstractContest> contests = this.contestsCache.get(key);
if (contests == null) {
ContestPersistence contestPersistence = PersistenceManager.getInstance().getContestPersistence();
if (contestType == 1) {
contests = contestPersistence.getAllProblemsets();
} else if (contestType == 0) {
contests = contestPersistence.getAllContests();
} else {
contests = contestPersistence.getAllCourses();
}
this.contestsCache.put(key, contests);
}
return contests;
}
}
Aggregations