KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > clustering > Data


1 /**
2  *
3  * Copyright 2003-2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.geronimo.clustering;
19
20 import java.util.HashMap JavaDoc;
21 import java.util.Map JavaDoc;
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24
25 // TODO - should this just inherit from HashMap ?
26

27 /**
28  * An object capable of holding the state of multiple applications and
29  * tiers. This will be a Map of tiers (web, ejb, ...). Each tier may
30  * choose how to organise it's own Map. e.g. Web tier will use a Map
31  * of webapps. Each webapp being represented by a Map of
32  * HttpSessionID:HttpSession. Assuming that all IDs where GUIDs, it
33  * would be posible to collapse all webapps together (and maybe all
34  * tiers), thus avoiding dehashing overhead with each lookup coming
35  * over the Cluster. I've considered this and decided that the extra
36  * partitioning of the data that I am doing, will result in much less
37  * contention on the Map used (particularly upon e.g. session
38  * creation), furthermore, by retaining references into the
39  * above-described structure, and distributing e.g. deltas across
40  * e.g. webapp specific Channels, this dehashing overhead could be
41  * avoided.<p> By using a Map of tiers, we avoid closing the set of
42  * clusterable services, but incur a little more synchronisation
43  * overhead on lookups, consider...
44  *
45  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
46  */

47 public class
48   Data
49 {
50   protected static Log _log=LogFactory.getLog(Data.class);
51   protected Map JavaDoc _tiers=new HashMap JavaDoc();
52
53   public Map JavaDoc getTiers(){return _tiers;};
54
55   public String JavaDoc toString(){return _tiers.toString();}
56 }
57
Popular Tags