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  /***
25   * This interface defines the behavior of the serialized element wrapper.
26   * <p>
27   * The value is stored as a byte array. This should allow for a variety of
28   * serialization mechanisms.
29   * <p>
30   * This currently extends ICacheElement for backward compatibility.
31   *
32   * @author Aaron Smuts
33   *
34   */
35  public interface ICacheElementSerialized
36      extends ICacheElement
37  {
38  
39      /***
40       * Gets the cacheName attribute of the ICacheElement object. The cacheName
41       * is also known as the region name.
42       *
43       * @return The cacheName value
44       */
45      public String getCacheName();
46  
47      /***
48       * Gets the key attribute of the ICacheElementSerialized object. This is the
49       * standard key that the value can be reference by.
50       *
51       * @return The key value
52       */
53      public Serializable getKey();
54  
55      /***
56       * Gets the value attribute of the ICacheElementSerialized object. This is
57       * the value the client cached seriailzed by some mechanism.
58       *
59       * @return The serialized value
60       */
61      public byte[] getSerializedValue();
62  
63      /***
64       * Gets the attributes attribute of the ICacheElement object
65       *
66       * @return The attributes value
67       */
68      public IElementAttributes getElementAttributes();
69  
70      /***
71       * Sets the attributes attribute of the ICacheElement object
72       *
73       * @param attr
74       *            The new attributes value
75       */
76      public void setElementAttributes( IElementAttributes attr );
77  
78  }