[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Mon Mar 19 15:03:34 EDT 2007
User: msurtani
Date: 07/03/19 15:03:34
Modified: src/org/jboss/cache CacheImpl.java RPCManager.java
RPCManagerImpl.java
Log:
JBCACHE-848 - putForExternalRead()
Revision Changes Path
1.55 +75 -59 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- CacheImpl.java 17 Mar 2007 19:11:03 -0000 1.54
+++ CacheImpl.java 19 Mar 2007 19:03:34 -0000 1.55
@@ -2028,6 +2028,11 @@
/* ----- These are VERSIONED callbacks to facilitate JBCACHE-843. Also see docs/design/DataVersion.txt --- */
+ public void _putForExternalRead(GlobalTransaction gtx, Fqn fqn, Object key, Object value, DataVersion dv) throws CacheException
+ {
+ _putForExternalRead(gtx, fqn, key, value);
+ }
+
public void _put(GlobalTransaction tx, Fqn fqn, Map data, boolean create_undo_ops, DataVersion dv) throws CacheException
{
_put(tx, fqn, data, create_undo_ops, false, dv);
@@ -4155,12 +4160,23 @@
public void putForExternalRead(Fqn fqn, K key, V value)
{
- // TODO Implement this method PROPERLY as per JBCACHE-848
- // NOTE: DO NOT disable this method prior to JBCACHE-848 being
- // completed. Imperfect as it is, the impl below at least allows
- // basic EJB3 testing with JBC 2.0.0
+ // if the node exists then this should be a no-op.
+ if (peek(fqn, false) == null)
+ {
getInvocationContext().getOptionOverrides().setFailSilently(true);
- put(fqn, key, value);
+ GlobalTransaction tx = getCurrentTransaction();
+ MethodCall m = MethodCallFactory.create(MethodDeclarations.putForExternalReadMethodLocal, tx, fqn, key, value);
+ invokeMethod(m);
+ }
+ else
+ {
+ log.debug("putForExternalRead() called with Fqn " + fqn + " and this node already exists. This method is hence a no op.");
+ }
+ }
+
+ public void _putForExternalRead(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
+ {
+ _put(gtx, fqn, key, value, true);
}
public boolean isStarted()
1.10 +2 -0 JBossCache/src/org/jboss/cache/RPCManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RPCManager.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RPCManager.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- RPCManager.java 16 Mar 2007 17:48:17 -0000 1.9
+++ RPCManager.java 19 Mar 2007 19:03:34 -0000 1.10
@@ -18,6 +18,8 @@
public List callRemoteMethods(List<Address> recipients, Method method, Object[] arguments, boolean synchronous, boolean excludeSelf, long timeout) throws Exception;
+ public void setCache(CacheSPI c);
+
/**
* @return Returns the replication queue (if one is used), null otherwise.
*/
1.2 +7 -2 JBossCache/src/org/jboss/cache/RPCManagerImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RPCManagerImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RPCManagerImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- RPCManagerImpl.java 16 Mar 2007 17:48:17 -0000 1.1
+++ RPCManagerImpl.java 19 Mar 2007 19:03:34 -0000 1.2
@@ -28,9 +28,9 @@
{
}
- private RPCManagerImpl(CacheImpl c)
+ private RPCManagerImpl(CacheSPI c)
{
- this.c = c;
+ this.c = (CacheImpl) c;
}
public static RPCManager getInstance(CacheImpl c)
@@ -72,6 +72,11 @@
return c.callRemoteMethods(recipients, method, arguments, synchronous, excludeSelf, timeout);
}
+ public void setCache(CacheSPI c)
+ {
+ this.c = (CacheImpl) c;
+ }
+
/**
* @return Returns the replication queue (if one is used), null otherwise.
*/
More information about the jboss-cvs-commits
mailing list