View Javadoc

1   package org.apache.jcs.auxiliary;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with 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,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.IOException;
23  import java.io.Serializable;
24  import java.util.Set;
25  
26  import org.apache.jcs.engine.behavior.ICache;
27  import org.apache.jcs.engine.behavior.ICacheElement;
28  import org.apache.jcs.engine.stats.behavior.IStats;
29  
30  /***
31   * Tag interface for auxiliary caches. Currently this provides no additional methods over what is in
32   * ICache, but I anticipate that will change. For example, there will be a mechanism for determining
33   * the type (disk/lateral/remote) of the auxiliary here -- and the existing getCacheType will be
34   * removed from ICache.
35   * @version $Id: AuxiliaryCache.java 536904 2007-05-10 16:03:42Z tv $
36   */
37  public interface AuxiliaryCache
38      extends ICache
39  {
40      /***
41       * Puts an item to the cache.
42       * @param ce
43       * @throws IOException
44       */
45      public void update( ICacheElement ce )
46          throws IOException;
47  
48      /***
49       * Gets an item from the cache.
50       * @param key
51       * @return
52       * @throws IOException
53       */
54      public ICacheElement get( Serializable key )
55          throws IOException;
56  
57      /***
58       * Removes an item from the cache.
59       * @param key
60       * @return
61       * @throws IOException
62       */
63      public boolean remove( Serializable key )
64          throws IOException;
65  
66      /***
67       * Removes all cached items from the cache.
68       * @throws IOException
69       */
70      public void removeAll()
71          throws IOException;
72  
73      /***
74       * Prepares for shutdown.
75       * @throws IOException
76       */
77      public void dispose()
78          throws IOException;
79  
80      /***
81       * Returns the current cache size.
82       * @return
83       */
84      public int getSize();
85  
86      /***
87       * Returns the cache status.
88       * @return
89       */
90      public int getStatus();
91  
92      /***
93       * Returns the cache name.
94       * @return
95       */
96      public String getCacheName();
97  
98      /***
99       * Gets the set of keys of objects currently in the group
100      * @param group
101      * @return a set of group keys
102      * @throws IOException
103      */
104     public Set getGroupKeys( String group )
105         throws IOException;
106 
107     /***
108      * Returns the historical and statistical data for a region's auxiliary cache.
109      * @return
110      */
111     public IStats getStatistics();
112 
113     /***
114      * This returns the generic attributes for an auxiliary cache. Most implementations will cast
115      * this to a more specific type.
116      * <p>
117      * @return
118      */
119     public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes();
120 }