1 |
/* |
2 |
* i-scream central monitoring system |
3 |
* http://www.i-scream.org |
4 |
* 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 |
//---PACKAGE DECLARATION--- |
22 |
package uk.org.iscream.cms.server.componentmanager; |
23 |
|
24 |
//---IMPORTS--- |
25 |
import uk.org.iscream.cms.server.core.*; |
26 |
import java.util.*; |
27 |
|
28 |
/** |
29 |
* ConfigurationCache class |
30 |
* 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 |
* |
37 |
* @author $Author: tdb $ |
38 |
* @version $Id: ConfigurationCache.java,v 1.7 2002/05/21 16:47:17 tdb Exp $ |
39 |
*/ |
40 |
public class ConfigurationCache { |
41 |
|
42 |
//---FINAL ATTRIBUTES--- |
43 |
|
44 |
/** |
45 |
* The current CVS revision of this class |
46 |
*/ |
47 |
public static final String REVISION = "$Revision: 1.7 $"; |
48 |
|
49 |
//---STATIC METHODS--- |
50 |
|
51 |
//---CONSTRUCTORS--- |
52 |
|
53 |
/** |
54 |
* Construct a ConfigurationCache |
55 |
* |
56 |
* @param config a reference to the CORBA Configuration object this cache will hold |
57 |
* @param propertyCache a hashMap to hold cached properties |
58 |
*/ |
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 |
/** |
71 |
* Obtins the hash containing cached |
72 |
* configuration property values. |
73 |
* |
74 |
* @return the property cache |
75 |
*/ |
76 |
public HashMap getPropertyCache() { |
77 |
return _propertyCache; |
78 |
} |
79 |
|
80 |
/** |
81 |
* Obtains the reference to the |
82 |
* CORBA configuration object this |
83 |
* cache holds. |
84 |
* |
85 |
* @return the configuration object |
86 |
*/ |
87 |
public Configuration getConfig() { |
88 |
return _config; |
89 |
} |
90 |
|
91 |
/** |
92 |
* Sets this cache to hold a new CORBA |
93 |
* Configuration object. |
94 |
* |
95 |
* @param config the new CORBA Configuration object |
96 |
*/ |
97 |
public void setConfig(Configuration config) { |
98 |
_config = config; |
99 |
} |
100 |
|
101 |
/** |
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 |
public void setPropertyCache(HashMap propertyCache) { |
108 |
_propertyCache = propertyCache; |
109 |
} |
110 |
|
111 |
//---ATTRIBUTES--- |
112 |
|
113 |
/** |
114 |
* A hash that contains cached property values |
115 |
*/ |
116 |
private HashMap _propertyCache; |
117 |
|
118 |
/** |
119 |
* The Configuration this configuration cache looks after |
120 |
*/ |
121 |
private Configuration _config; |
122 |
|
123 |
//---STATIC ATTRIBUTES--- |
124 |
|
125 |
} |