[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Mon Nov 27 12:07:05 EST 2006
User: msurtani
Date: 06/11/27 12:07:05
Modified: src/org/jboss/cache TreeCacheProxyImpl.java CacheSPI.java
Log:
Added marshaller to SPI
Revision Changes Path
1.53 +21 -17 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.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- TreeCacheProxyImpl.java 21 Nov 2006 08:57:01 -0000 1.52
+++ TreeCacheProxyImpl.java 27 Nov 2006 17:07:05 -0000 1.53
@@ -1,12 +1,12 @@
-package org.jboss.cache;/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+package org.jboss.cache;
+
+/*
+* JBoss, Home of Professional Open Source
+*
+* Distributable under LGPL license.
+* See terms of license at gnu.org.
+*/
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.config.Configuration;
@@ -14,8 +14,8 @@
import org.jboss.cache.interceptors.Interceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
-import org.jboss.cache.lock.IdentityLock;
import org.jboss.cache.marshall.MethodCall;
+import org.jboss.cache.marshall.VersionAwareMarshaller;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jgroups.Address;
@@ -23,9 +23,6 @@
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -239,8 +236,10 @@
{
NodeImpl n = treeCache.get(fqn);
if (n != null)
+ {
evictChildren(n);
}
+ }
else
{
treeCache.evict(fqn);
@@ -312,6 +311,11 @@
return treeCache.gravitateData(fqn, searchSubtrees, marshal);
}
+ public VersionAwareMarshaller getMarshaller()
+ {
+ return treeCache.getMarshaller();
+ }
+
public Notifier getNotifier()
{
return treeCache.getNotifier();
1.22 +23 -7 JBossCache/src/org/jboss/cache/CacheSPI.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheSPI.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheSPI.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- CacheSPI.java 20 Nov 2006 03:53:54 -0000 1.21
+++ CacheSPI.java 27 Nov 2006 17:07:05 -0000 1.22
@@ -12,14 +12,14 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.MethodCall;
+import org.jboss.cache.marshall.VersionAwareMarshaller;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
+import javax.transaction.Transaction;
import java.util.List;
import java.util.Map;
-import javax.transaction.Transaction;
-
/**
* A more detailed interface to {@link Cache}, which is used when writing plugins for or extending JBoss Cache.
*
@@ -93,8 +93,8 @@
// - these two should be static methods on the InvocationContext class
// since the current context lives in thread local.
-// void setInvocationContext(InvocationContext ctx);
-// InvocationContext getInvocationContext();
+ // void setInvocationContext(InvocationContext ctx);
+ // InvocationContext getInvocationContext();
// everything that is not already represented by Cache
// that is used by either an interceptor, or eviction policy
@@ -117,6 +117,7 @@
/**
* Returns the global transaction for this local transaction.
* Optionally creates a new global transaction if it does not exist.
+ *
* @param createIfNotExists if true creates a new transaction if none exists
*/
GlobalTransaction getCurrentTransaction(Transaction tx, boolean createIfNotExists);
@@ -129,13 +130,28 @@
/**
* Returns a node without accessing the interceptor chain.
+ *
* @return a node if one exists or null
*/
Node peek(Fqn fqn);
/**
* Used with buddy replication's data gravitation interceptor
+ *
* @return a List which should be a data structure
*/
GravitateResult gravitateData(Fqn fqn, boolean searchSubtrees, boolean marshal);
+
+ /**
+ * Retrieves an instance of a {@link VersionAwareMarshaller}, which is capable of
+ * converting Java objects to bytestreams and back in an efficient manner, which is
+ * also interoperable with bytestreams produced/consumed by other versions of JBoss
+ * Cache.
+ * <p/>
+ * The use of this marshaller is the <b>recommended</b> way of creating efficient,
+ * compatible, version-aware byte streams from objects.
+ *
+ * @return an instance of {@link VersionAwareMarshaller}
+ */
+ VersionAwareMarshaller getMarshaller();
}
More information about the jboss-cvs-commits
mailing list