KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > naming > resources > CacheEntry


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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.naming.resources;
19
20 import javax.naming.directory.DirContext JavaDoc;
21
22 /**
23  * Implements a cache entry.
24  *
25  * @author <a HREF="mailto:remm@apache.org">Remy Maucherat</a>
26  * @version $Revision: 467222 $
27  */

28 public class CacheEntry {
29     
30     
31     // ------------------------------------------------- Instance Variables
32

33
34     public long timestamp = -1;
35     public String JavaDoc name = null;
36     public ResourceAttributes attributes = null;
37     public Resource resource = null;
38     public DirContext JavaDoc context = null;
39     public boolean exists = true;
40     public long accessCount = 0;
41     public int size = 1;
42
43
44     // ----------------------------------------------------- Public Methods
45

46
47     public void recycle() {
48         timestamp = -1;
49         name = null;
50         attributes = null;
51         resource = null;
52         context = null;
53         exists = true;
54         accessCount = 0;
55         size = 1;
56     }
57
58
59     public String JavaDoc toString() {
60         return ("Cache entry: " + name + "\n"
61                 + "Exists: " + exists + "\n"
62                 + "Attributes: " + attributes + "\n"
63                 + "Resource: " + resource + "\n"
64                 + "Context: " + context);
65     }
66
67
68 }
69
Popular Tags