View Javadoc

1   package org.apache.jcs.engine.behavior;
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.Serializable;
23  
24  import org.apache.jcs.engine.behavior.IElementAttributes;
25  
26  /***
27   * Every item is the cache is wrapped in an ICacheElement. This contains
28   * information about the element: the region name, the key, the value, and the
29   * element attributes.
30   * <p>
31   * The element attributes have lots of useful information about each elment,
32   * such as when they were created, how long they have to live, and if they are
33   * allowed to be spooled, etc.
34   *
35   */
36  public interface ICacheElement
37      extends Serializable
38  {
39  
40      /***
41       * Gets the cacheName attribute of the ICacheElement object. The cacheName
42       * is also known as the region name.
43       *
44       * @return The cacheName value
45       */
46      public String getCacheName();
47  
48      /***
49       * Gets the key attribute of the ICacheElement object
50       *
51       * @return The key value
52       */
53      public Serializable getKey();
54  
55      /***
56       * Gets the val attribute of the ICacheElement object
57       *
58       * @return The val value
59       */
60      public Serializable getVal();
61  
62      /***
63       * Gets the attributes attribute of the ICacheElement object
64       *
65       * @return The attributes value
66       */
67      public IElementAttributes getElementAttributes();
68  
69      /***
70       * Sets the attributes attribute of the ICacheElement object
71       *
72       * @param attr
73       *            The new attributes value
74       */
75      public void setElementAttributes( IElementAttributes attr );
76  }