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