KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > api > cintoo > messages > context > ContextCache


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

16 package api.cintoo.messages.context;
17
18 import api.cintoo.messages.bundle.BaseBundle;
19
20 import java.util.Locale JavaDoc;
21
22 /**
23  * Context cache is caching a bundle for a context to
24  * reduce searchs for the corresponding bundles.
25  *
26  * @author Stephan J. Schmidt
27  * @version $id$
28  * @since 1.0
29  */

30 public interface ContextCache {
31
32     /**
33      * Add bundle and context to cache
34      *
35      * @param context context with the scope of the bundle
36      * @param locale locale for the bundle
37      * @param bundle factory which creates bundles form a locale
38      */

39     public void addToCache(Context context, Locale JavaDoc locale, BaseBundle bundle);
40
41     /**
42      * Retrieve a cached bundle
43      *
44      * @param context context for the wanted bundle
45      * @param locale locale for the bundle
46      * @return cached bundle
47      */

48     public BaseBundle getFromCache(Context context, Locale JavaDoc locale);
49
50     /**
51      * Check if a context is cached
52      *
53      * @param context context to check if it is cached
54      * @param locale locale for the bundle
55      * @return true if the context is cached
56      */

57     public boolean isCached(Context context, Locale JavaDoc locale);
58
59     /**
60      * Clear the cache
61      */

62     public void clear();
63 }
64
Popular Tags