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.naming.resources;
19:
20: import javax.naming.directory.DirContext;
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: // ------------------------------------------------- Instance Variables
31:
32: public long timestamp = -1;
33: public String name = null;
34: public ResourceAttributes attributes = null;
35: public Resource resource = null;
36: public DirContext context = null;
37: public boolean exists = true;
38: public long accessCount = 0;
39: public int size = 1;
40:
41: // ----------------------------------------------------- Public Methods
42:
43: public void recycle() {
44: timestamp = -1;
45: name = null;
46: attributes = null;
47: resource = null;
48: context = null;
49: exists = true;
50: accessCount = 0;
51: size = 1;
52: }
53:
54: public String toString() {
55: return ("Cache entry: " + name + "\n" + "Exists: " + exists
56: + "\n" + "Attributes: " + attributes + "\n"
57: + "Resource: " + resource + "\n" + "Context: " + context);
58: }
59:
60: }
|