KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > fjank > jcache > CacheRegion


1 /* Open Source Java Caching Service
2 * Copyright (C) 2002 Frank Karlstrøm
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * The author can be contacted by email: fjankk@users.sourceforge.net
18 */

19 package org.fjank.jcache;
20
21
22
23 /**
24  * This class defines a region in the cache.
25  *
26  * @author Frank Karlstrøm
27  */

28 public class CacheRegion extends org.fjank.jcache.CacheGroup {
29     /** the default region in the cache. */
30     private static CacheRegion defaultRegion;
31
32     /**
33      * Creates new CacheRegionObject
34      *
35      * @param name the name of the new region.
36      * @param attributes the attributes for the new region.
37      */

38     public CacheRegion(final String JavaDoc name, final AttributesImpl attributes) {
39         super(name, attributes);
40     }
41
42     /**
43      * returns the default region in the cache.
44      *
45      * @return the default region in the cache.
46      */

47     public static synchronized CacheRegion getRegion() {
48         if (defaultRegion == null) {
49             defaultRegion = new CacheRegion(null, null);
50         }
51         return defaultRegion;
52     }
53
54     /**
55      * returns a String representation of this region.
56      *
57      * @return a String representation of this region.
58      */

59     public String JavaDoc toString() {
60         return name + " " + weakReferenceObjects;
61     }
62
63     
64
65     
66 }
67
Popular Tags