[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Thu Nov 2 07:35:23 EST 2006
User: msurtani
Date: 06/11/02 07:35:23
Modified: src/org/jboss/cache Cache.java TreeCacheProxyImpl.java
Log:
Added placeholder for putForExternalRead()
Revision Changes Path
1.13 +19 -0 JBossCache/src/org/jboss/cache/Cache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Cache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Cache.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Cache.java 31 Oct 2006 23:19:56 -0000 1.12
+++ Cache.java 2 Nov 2006 12:35:23 -0000 1.13
@@ -98,6 +98,25 @@
void put(Fqn fqn, Object key, Object value);
/**
+ * For use cases that have an external representation and storage of data objects, doing a put() in the cache
+ * should not have as strong a set of semantics as though when the cache is in itself the main form of storing data.
+ * <p/>
+ * In these cases, a putForExternalRead() should be used instead of a put() - the key differences being:
+ * <p/>
+ * <ul>
+ * <li> Ongoing transactions are suspended before this call, so failures here will not affect any ongoing transactions.</li>
+ * <li> Errors and exceptions are 'silent' - logged at a muhc lower level than normal, and this method does not throw exceptions</li>
+ * <li> Lock acquisition timeouts are dropped to 0 to improve performance</li>
+ * <li> If pessimistic locking is used, write locks are not obtained here - even though this is a write. Instead, read locks are used.<li>
+ * </ul>
+ *
+ * @param fqn
+ * @param key
+ * @param value
+ */
+ void putForExternalRead(Fqn fqn, Object key, Object value);
+
+ /**
* Convenience method that allows for direct access to the data in a {@link Node}.
*
* @param fqn
1.46 +6 -0 JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheProxyImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- TreeCacheProxyImpl.java 31 Oct 2006 23:19:56 -0000 1.45
+++ TreeCacheProxyImpl.java 2 Nov 2006 12:35:23 -0000 1.46
@@ -219,6 +219,12 @@
treeCache.put(fqn, key, value);
}
+ public void putForExternalRead(Fqn fqn, Object key, Object value)
+ {
+ // TODO Implement this method
+ throw new RuntimeException("TODO: Needs to be implemented");
+ }
+
public void put(Fqn fqn, Map data)
{
treeCache.put(fqn, data);
More information about the jboss-cvs-commits
mailing list