1 |
tdb |
1.6 |
/* |
2 |
|
|
* i-scream central monitoring system |
3 |
tdb |
1.8 |
* http://www.i-scream.org |
4 |
tdb |
1.6 |
* Copyright (C) 2000-2002 i-scream |
5 |
|
|
* |
6 |
|
|
* This program is free software; you can redistribute it and/or |
7 |
|
|
* modify it under the terms of the GNU General Public License |
8 |
|
|
* as published by the Free Software Foundation; either version 2 |
9 |
|
|
* of the License, or (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
|
|
*/ |
20 |
|
|
|
21 |
ajm |
1.1 |
//---PACKAGE DECLARATION--- |
22 |
tdb |
1.5 |
package uk.org.iscream.cms.server.componentmanager; |
23 |
ajm |
1.1 |
|
24 |
|
|
//---IMPORTS--- |
25 |
tdb |
1.5 |
import uk.org.iscream.cms.server.core.*; |
26 |
ajm |
1.1 |
import java.util.*; |
27 |
|
|
|
28 |
|
|
/** |
29 |
|
|
* ConfigurationCache class |
30 |
ajm |
1.4 |
* This is essentially a wrapper and cache for |
31 |
|
|
* Configuration CORBA objects. The ConfigurationProxy creates an instance |
32 |
|
|
* of this class for every Configuration that is requested. This class then |
33 |
|
|
* hold the reference to the configuration, but also maintains a cache where |
34 |
|
|
* the ConfigurationProxy can store cached property values to safe on CORBA |
35 |
|
|
* requests. |
36 |
ajm |
1.1 |
* |
37 |
tdb |
1.6 |
* @author $Author: tdb $ |
38 |
tdb |
1.8 |
* @version $Id: ConfigurationCache.java,v 1.7 2002/05/21 16:47:17 tdb Exp $ |
39 |
ajm |
1.1 |
*/ |
40 |
|
|
public class ConfigurationCache { |
41 |
|
|
|
42 |
|
|
//---FINAL ATTRIBUTES--- |
43 |
|
|
|
44 |
|
|
/** |
45 |
|
|
* The current CVS revision of this class |
46 |
|
|
*/ |
47 |
tdb |
1.8 |
public static final String REVISION = "$Revision: 1.7 $"; |
48 |
ajm |
1.1 |
|
49 |
|
|
//---STATIC METHODS--- |
50 |
|
|
|
51 |
|
|
//---CONSTRUCTORS--- |
52 |
|
|
|
53 |
|
|
/** |
54 |
|
|
* Construct a ConfigurationCache |
55 |
|
|
* |
56 |
ajm |
1.4 |
* @param config a reference to the CORBA Configuration object this cache will hold |
57 |
|
|
* @param propertyCache a hashMap to hold cached properties |
58 |
ajm |
1.1 |
*/ |
59 |
|
|
public ConfigurationCache(Configuration config, HashMap propertyCache) { |
60 |
|
|
_propertyCache = propertyCache; |
61 |
|
|
_config = config; |
62 |
|
|
} |
63 |
|
|
|
64 |
|
|
//---PUBLIC METHODS--- |
65 |
|
|
|
66 |
|
|
//---PRIVATE METHODS--- |
67 |
|
|
|
68 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
69 |
|
|
|
70 |
ajm |
1.4 |
/** |
71 |
|
|
* Obtins the hash containing cached |
72 |
|
|
* configuration property values. |
73 |
|
|
* |
74 |
|
|
* @return the property cache |
75 |
|
|
*/ |
76 |
ajm |
1.1 |
public HashMap getPropertyCache() { |
77 |
|
|
return _propertyCache; |
78 |
|
|
} |
79 |
|
|
|
80 |
ajm |
1.4 |
/** |
81 |
|
|
* Obtains the reference to the |
82 |
|
|
* CORBA configuration object this |
83 |
|
|
* cache holds. |
84 |
|
|
* |
85 |
|
|
* @return the configuration object |
86 |
|
|
*/ |
87 |
ajm |
1.1 |
public Configuration getConfig() { |
88 |
|
|
return _config; |
89 |
|
|
} |
90 |
|
|
|
91 |
ajm |
1.4 |
/** |
92 |
|
|
* Sets this cache to hold a new CORBA |
93 |
|
|
* Configuration object. |
94 |
|
|
* |
95 |
|
|
* @param config the new CORBA Configuration object |
96 |
|
|
*/ |
97 |
ajm |
1.1 |
public void setConfig(Configuration config) { |
98 |
|
|
_config = config; |
99 |
|
|
} |
100 |
|
|
|
101 |
ajm |
1.4 |
/** |
102 |
|
|
* Sets this cache to hold a new property |
103 |
|
|
* cache. |
104 |
|
|
* |
105 |
|
|
* @param propertyCache the new hash map to containing a property cache |
106 |
|
|
*/ |
107 |
ajm |
1.1 |
public void setPropertyCache(HashMap propertyCache) { |
108 |
|
|
_propertyCache = propertyCache; |
109 |
|
|
} |
110 |
|
|
|
111 |
|
|
//---ATTRIBUTES--- |
112 |
|
|
|
113 |
ajm |
1.4 |
/** |
114 |
|
|
* A hash that contains cached property values |
115 |
|
|
*/ |
116 |
ajm |
1.1 |
private HashMap _propertyCache; |
117 |
ajm |
1.4 |
|
118 |
|
|
/** |
119 |
|
|
* The Configuration this configuration cache looks after |
120 |
|
|
*/ |
121 |
ajm |
1.1 |
private Configuration _config; |
122 |
|
|
|
123 |
|
|
//---STATIC ATTRIBUTES--- |
124 |
|
|
|
125 |
|
|
} |