KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > cache > CacheFactory


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.cache.CacheFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.cache;
23
24 /**
25     A factory for handing out caches.
26 */

27 public interface CacheFactory {
28     
29     /**
30         Create a cache that uses the class represented by holderClass as
31         the holder class. This holderClass must implement Cacheable.
32
33         @param holderFactory The factory for the objects that are to be cached.
34         @param name The name of the cache
35         @param initialSize The number of initial holder objects that will be created
36         @param maximumSize The maximum number of objects the cache will hold
37  
38     */

39     
40     public CacheManager newCacheManager(CacheableFactory holderFactory, String JavaDoc name,
41                                         int initialSize, int maximumSize);
42     
43     /**
44         Create a cache that uses the class represented by holderClass as
45         the holder class. This holderClass must implement Cacheable.
46
47         @param holderFactory The Class object representing the holder class.
48         @param name The name of the cache
49         @param initialSize The number of initial holder objects that will be created
50         @param maximumSize The maximum total size of the objects that the cache will hold
51  
52     */

53     
54     public CacheManager newSizedCacheManager(CacheableFactory holderFactory, String JavaDoc name,
55                                         int initialSize, long maximumSize);
56 }
57
58
Popular Tags