1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * 9 * http://www.apache.org/licenses/LICENSE-2.010 * 11 * Unless required by applicable law or agreed to in writing, software12 * 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 and15 * limitations under the License.16 */17packageorg.apache.jetspeed.cache.impl;
1819import java.io.Serializable;
2021import net.sf.ehcache.Element;
2223import org.apache.jetspeed.cache.CacheElement;
2425publicclassEhCacheElementImpl implements CacheElement
26 {
27 Element element;
2829publicEhCacheElementImpl(Element element)
30 {
31this.element = element;
32 }
3334publicEhCacheElementImpl(Serializable key, Serializable value)
35 {
36this.element = new Element(key,value);
37 }
3839publicEhCacheElementImpl(Serializable key, Object value)
40 {
41this.element = new Element(key,value);
42 }
4344public Object getKey()
45 {
46return element.getObjectKey();
47 }
484950public Object getContent()
51 {
52return element.getObjectValue();
53 }
5455publicint getTimeToIdleSeconds()
56 {
57return element.getTimeToIdle();
58 }
5960publicint getTimeToLiveSeconds()
61 {
62return element.getTimeToLive();
63 }
6465publicboolean isEternal()
66 {
67return element.isEternal();
68 }
6970public Element getImplElement()
71 {
72return element;
73 }
7475publicvoid setEternal(boolean eternal)
76 {
77 element.setEternal(eternal);
78 }
7980publicvoid setTimeToIdleSeconds(int timeToIdle)
81 {
82 element.setTimeToIdle(timeToIdle);
83 }
8485publicvoid setTimeToLiveSeconds(int timeToLive)
86 {
87 element.setTimeToLive(timeToLive);
88 }
89 }