[jboss-cvs] JBossCache/src/org/jboss/cache/loader/rmi ...
Manik Surtani
msurtani at jboss.com
Fri Sep 22 12:27:56 EDT 2006
User: msurtani
Date: 06/09/22 12:27:56
Modified: src/org/jboss/cache/loader/rmi RemoteTreeCache.java
RemoteTreeCacheImpl.java
Log:
- Modification types to Enums.
- Abstracted put(List)
Revision Changes Path
1.8 +13 -5 JBossCache/src/org/jboss/cache/loader/rmi/RemoteTreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RemoteTreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/rmi/RemoteTreeCache.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- RemoteTreeCache.java 21 Jun 2006 11:10:58 -0000 1.7
+++ RemoteTreeCache.java 22 Sep 2006 16:27:56 -0000 1.8
@@ -13,24 +13,32 @@
import java.rmi.RemoteException;
import java.util.Map;
import java.util.Set;
-import java.util.List;
/**
* Remote interface to a {@link org.jboss.cache.TreeCache} instance. Used by
* {@link org.jboss.cache.loader.RmiDelegatingCacheLoader}.
*
* @author Daniel Gredler
- * @version $Id: RemoteTreeCache.java,v 1.7 2006/06/21 11:10:58 msurtani Exp $
+ * @version $Id: RemoteTreeCache.java,v 1.8 2006/09/22 16:27:56 msurtani Exp $
*/
-public interface RemoteTreeCache extends Remote {
+public interface RemoteTreeCache extends Remote
+{
public Set getChildrenNames(Fqn fqn) throws Exception, RemoteException;
+
public Object get(Fqn name, Object key) throws Exception, RemoteException;
+
public NodeImpl get(Fqn name) throws Exception, RemoteException;
+
public boolean exists(Fqn name) throws Exception, RemoteException;
+
public Object put(Fqn name, Object key, Object value) throws Exception, RemoteException;
+
public void put(Fqn name, Map attributes) throws Exception, RemoteException;
- public void put(List modifications) throws Exception, RemoteException;
+// public void put(List modifications) throws Exception, RemoteException;
+
public Object remove(Fqn name, Object key) throws Exception, RemoteException;
+
public void remove(Fqn name) throws Exception, RemoteException;
+
public void removeData(Fqn name) throws Exception, RemoteException;
}
1.10 +27 -47 JBossCache/src/org/jboss/cache/loader/rmi/RemoteTreeCacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RemoteTreeCacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/rmi/RemoteTreeCacheImpl.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- RemoteTreeCacheImpl.java 19 Jul 2006 21:34:44 -0000 1.9
+++ RemoteTreeCacheImpl.java 22 Sep 2006 16:27:56 -0000 1.10
@@ -7,14 +7,11 @@
package org.jboss.cache.loader.rmi;
import org.jboss.cache.Fqn;
-import org.jboss.cache.Modification;
import org.jboss.cache.NodeImpl;
import org.jboss.cache.TreeCache;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -22,9 +19,10 @@
* Implementation of the {@link org.jboss.cache.TreeCache}'s remote interface.
*
* @author Daniel Gredler
- * @version $Id: RemoteTreeCacheImpl.java,v 1.9 2006/07/19 21:34:44 msurtani Exp $
+ * @version $Id: RemoteTreeCacheImpl.java,v 1.10 2006/09/22 16:27:56 msurtani Exp $
*/
-public class RemoteTreeCacheImpl extends UnicastRemoteObject implements RemoteTreeCache {
+public class RemoteTreeCacheImpl extends UnicastRemoteObject implements RemoteTreeCache
+{
private static final long serialVersionUID = 3096209368650710385L;
@@ -35,98 +33,80 @@
* @throws RemoteException
*/
//public RemoteTreeCacheImpl(TreeCacheMBean cache) throws RemoteException {
- public RemoteTreeCacheImpl(TreeCache cache) throws RemoteException {
- this.cache=cache;
+ public RemoteTreeCacheImpl(TreeCache cache) throws RemoteException
+ {
+ this.cache = cache;
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#getChildrenNames(org.jboss.cache.Fqn)
*/
- public Set getChildrenNames(Fqn fqn) throws Exception, RemoteException {
+ public Set getChildrenNames(Fqn fqn) throws Exception, RemoteException
+ {
return this.cache.getChildrenNames(fqn);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#get(org.jboss.cache.Fqn, java.lang.Object)
*/
- public Object get(Fqn name, Object key) throws Exception, RemoteException {
+ public Object get(Fqn name, Object key) throws Exception, RemoteException
+ {
return this.cache.get(name, key);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#get(org.jboss.cache.Fqn)
*/
- public NodeImpl get(Fqn name) throws Exception, RemoteException {
+ public NodeImpl get(Fqn name) throws Exception, RemoteException
+ {
return this.cache.get(name);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#exists(org.jboss.cache.Fqn)
*/
- public boolean exists(Fqn name) throws Exception, RemoteException {
+ public boolean exists(Fqn name) throws Exception, RemoteException
+ {
return this.cache.exists(name);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
*/
- public Object put(Fqn name, Object key, Object value) throws Exception, RemoteException {
+ public Object put(Fqn name, Object key, Object value) throws Exception, RemoteException
+ {
return this.cache.put(name, key, value);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#put(org.jboss.cache.Fqn, java.util.Map)
*/
- public void put(Fqn name, Map attributes) throws Exception, RemoteException {
+ public void put(Fqn name, Map attributes) throws Exception, RemoteException
+ {
this.cache.put(name, attributes);
}
- public void put(List modifications) throws Exception, RemoteException {
- for(Iterator it=modifications.iterator(); it.hasNext();) {
- Modification m=(Modification)it.next();
- switch(m.getType()) {
- case Modification.PUT_DATA:
- case Modification.PUT_DATA_ERASE:
- cache.put(m.getFqn(), m.getData());
- break;
- case Modification.PUT_KEY_VALUE:
- cache.put(m.getFqn(), m.getKey(), m.getValue());
- break;
- case Modification.REMOVE_DATA:
- cache.removeData(m.getFqn());
- break;
- case Modification.REMOVE_KEY_VALUE:
- cache.remove(m.getFqn(), m.getKey());
- break;
- case Modification.REMOVE_NODE:
- cache.remove(m.getFqn());
- break;
- default:
- System.err.println("modification type " + m.getType() + " not known");
- break;
- }
- }
-
- }
-
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#remove(org.jboss.cache.Fqn, java.lang.Object)
*/
- public Object remove(Fqn name, Object key) throws Exception, RemoteException {
+ public Object remove(Fqn name, Object key) throws Exception, RemoteException
+ {
return this.cache.remove(name, key);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#remove(org.jboss.cache.Fqn)
*/
- public void remove(Fqn name) throws Exception, RemoteException {
+ public void remove(Fqn name) throws Exception, RemoteException
+ {
this.cache.remove(name);
}
/**
* @see org.jboss.cache.loader.rmi.RemoteTreeCache#removeData(org.jboss.cache.Fqn)
*/
- public void removeData(Fqn name) throws Exception, RemoteException {
+ public void removeData(Fqn name) throws Exception, RemoteException
+ {
this.cache.removeData(name);
}
}
More information about the jboss-cvs-commits
mailing list