Merge branch 'develop' of wp5.e-taxonomy.eu:/var/git/taxeditor into remoting-4.0
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / cdm / api / application / CdmApplicationState.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.api.application;
11
12 /**
13 * @author cmathew
14 * @date 17 Jun 2015
15 *
16 */
17 public class CdmApplicationState {
18
19 private static CdmApplicationState cdmApplicationState;
20
21 private ICdmApplicationConfiguration appConfig;
22
23 public static CdmApplicationState getInstance() {
24 if(cdmApplicationState == null) {
25 cdmApplicationState = new CdmApplicationState();
26 }
27 return cdmApplicationState;
28 }
29
30 public void setAppConfig(ICdmApplicationConfiguration appConfig) {
31 this.appConfig = appConfig;
32 }
33
34 public ICdmApplicationConfiguration getAppConfig() {
35 return appConfig;
36 }
37
38 public static void setCurrentAppConfig(ICdmApplicationConfiguration appConfig) {
39 getInstance().setAppConfig(appConfig);
40 }
41
42 public static ICdmApplicationConfiguration getCurrentAppConfig() {
43 return getInstance().getAppConfig();
44 }
45
46 }