Guest User

Untitled

a guest
Jul 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. private State state; /* FLUID, FREEZING, FROZEN */
  2.  
  3. public void freeze() throws Exception {
  4. this.state = FREEZING;
  5. }
  6.  
  7. public ScenarioManagerEx getScenarioManager() throws Exception {
  8. if (isStale()) {
  9. buildScenarioManager();
  10. } else {
  11. logger.info("ScenarioManager is not stale ... Returning the current instance");
  12. }
  13. if (FREEZING == state) {
  14. state = FROZEN;
  15. logger.info("ScenarioManager frozen");
  16. }
  17. return scenarioManager;
  18. }
  19.  
  20. private boolean isStale() {
  21. return scenarioManager == null ||
  22. ((FROZEN != state) && confDao.get().getScenarioLastUpdated().after(scenarioLastUpdated));
  23.  
  24. }
Add Comment
Please, Sign In to add comment