01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.naming.resources;
18:
19: import javax.naming.directory.DirContext;
20:
21: /**
22: * Implements a cache entry.
23: *
24: * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
25: * @version $Revision: 1.2 $
26: */
27: public class CacheEntry {
28:
29: // ------------------------------------------------- Instance Variables
30:
31: public long timestamp = -1;
32: public String name = null;
33: public ResourceAttributes attributes = null;
34: public Resource resource = null;
35: public DirContext context = null;
36: public boolean exists = true;
37: public long accessCount = 0;
38: public int size = 1;
39:
40: // ----------------------------------------------------- Public Methods
41:
42: public void recycle() {
43: timestamp = -1;
44: name = null;
45: attributes = null;
46: resource = null;
47: context = null;
48: exists = true;
49: accessCount = 0;
50: size = 1;
51: }
52:
53: public String toString() {
54: return ("Cache entry: " + name + "\n" + "Exists: " + exists
55: + "\n" + "Attributes: " + attributes + "\n"
56: + "Resource: " + resource + "\n" + "Context: " + context);
57: }
58:
59: }
|