You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/07/25 00:41:05 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources ProxyDirContext.java
remm 01/07/24 15:41:05
Modified: catalina/src/share/org/apache/naming/resources
ProxyDirContext.java
Log:
- Add a cachingAllowed flag to enable / disable caching dynamically.
Revision Changes Path
1.5 +27 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java
Index: ProxyDirContext.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ProxyDirContext.java 2001/05/16 05:57:44 1.4
+++ ProxyDirContext.java 2001/07/24 22:41:05 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v 1.4 2001/05/16 05:57:44 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2001/05/16 05:57:44 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v 1.5 2001/07/24 22:41:05 remm Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/07/24 22:41:05 $
*
* ====================================================================
*
@@ -84,7 +84,7 @@
* Proxy Directory Context implementation.
*
* @author Remy Maucherat
- * @version $Revision: 1.4 $ $Date: 2001/05/16 05:57:44 $
+ * @version $Revision: 1.5 $ $Date: 2001/07/24 22:41:05 $
*/
public class ProxyDirContext implements DirContext {
@@ -165,6 +165,12 @@
protected int cacheTTL = 5000; // 5s
+ /**
+ * Caching allowed flag.
+ */
+ protected boolean cachingAllowed = true;
+
+
// --------------------------------------------------------- Public Methods
@@ -195,6 +201,22 @@
}
+ /**
+ * Is caching allowed ?
+ */
+ public boolean isCachingAllowed() {
+ return cachingAllowed;
+ }
+
+
+ /**
+ * Set caching allowed flag.
+ */
+ public void setCachingAllowed(boolean cachingAllowed) {
+ this.cachingAllowed = cachingAllowed;
+ }
+
+
// -------------------------------------------------------- Context Methods
@@ -1321,7 +1343,7 @@
* Lookup in cache.
*/
protected CacheEntry cacheLookup(String name) {
- if (cache == null)
+ if (!cachingAllowed || (cache == null))
return (null);
CacheEntry cacheEntry = (CacheEntry) cache.get(name);
if (cacheEntry == null) {