Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private State state; /* FLUID, FREEZING, FROZEN */
- public void freeze() throws Exception {
- this.state = FREEZING;
- }
- public ScenarioManagerEx getScenarioManager() throws Exception {
- if (isStale()) {
- buildScenarioManager();
- } else {
- logger.info("ScenarioManager is not stale ... Returning the current instance");
- }
- if (FREEZING == state) {
- state = FROZEN;
- logger.info("ScenarioManager frozen");
- }
- return scenarioManager;
- }
- private boolean isStale() {
- return scenarioManager == null ||
- ((FROZEN != state) && confDao.get().getScenarioLastUpdated().after(scenarioLastUpdated));
- }
Add Comment
Please, Sign In to add comment