01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.jetspeed.cache;
19:
20: /**
21: * <p>
22: * Provides interface to cached elements
23: * Abstraction around atual cache implementation
24: * </p>
25: *
26: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
27: * @version $Id: $
28: */
29: public interface CacheElement {
30: public static int ActionAdded = 1;
31: public static int ActionChanged = 2;
32: public static int ActionRemoved = -1;
33: public static int ActionEvicted = -2;
34: public static int ActionExpired = -3;
35:
36: /**
37: *
38: * @return the idle time in seconds for this cache element
39: */
40: int getTimeToIdleSeconds();
41:
42: /**
43: *
44: * @return the idle time in seconds for this cache element
45: */
46: int getTimeToLiveSeconds();
47:
48: void setTimeToLiveSeconds(int timeToLive);
49:
50: void setTimeToIdleSeconds(int timeToIdle);
51:
52: Object getContent();
53:
54: Object getKey();
55:
56: boolean isEternal();
57:
58: void setEternal(boolean eternal);
59:
60: }
|