[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...
Manik Surtani
msurtani at belmont.prod.atl2.jboss.com
Wed Aug 30 13:08:18 EDT 2006
User: msurtani
Date: 06/08/30 13:08:18
Modified: src/org/jboss/cache/loader ClusteredCacheLoader.java
Log:
Java5 optimisations
Revision Changes Path
1.12 +205 -204 JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClusteredCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoader.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ClusteredCacheLoader.java 25 Aug 2006 14:10:08 -0000 1.11
+++ ClusteredCacheLoader.java 30 Aug 2006 17:08:18 -0000 1.12
@@ -9,14 +9,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
import org.jboss.cache.Modification;
+import org.jboss.cache.TreeCache;
+import org.jboss.cache.marshall.MethodCall;
import org.jboss.cache.marshall.MethodCallFactory;
import org.jboss.cache.marshall.MethodDeclarations;
import org.jboss.cache.marshall.RegionManager;
-import org.jgroups.blocks.GroupRequest;
-import org.jboss.cache.marshall.MethodCall;
import org.jgroups.Address;
+import org.jgroups.blocks.GroupRequest;
import java.util.Iterator;
import java.util.List;
@@ -58,7 +58,7 @@
public Set<String> getChildrenNames(Fqn fqn) throws Exception
{
- MethodCall call = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, new Object[]{fqn});
+ MethodCall call = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, fqn);
Object resp = callRemote(call);
return (Set<String>) resp;
}
@@ -67,7 +67,7 @@
{
if (log.isTraceEnabled()) log.trace("cache=" + cache.getLocalAddress() + "; calling with " + call);
List<Address> mbrs = cache.getMembers();
- MethodCall clusteredGet = MethodCallFactory.create(MethodDeclarations.clusteredGetMethod, new Object[]{call, Boolean.FALSE});
+ MethodCall clusteredGet = MethodCallFactory.create(MethodDeclarations.clusteredGetMethod, call, false);
List resps = cache.getRPCManager().callRemoteMethods(mbrs, clusteredGet, GroupRequest.GET_FIRST, true, timeout);
if (resps == null)
{
@@ -79,12 +79,13 @@
// test for and remove exceptions
Iterator i = resps.iterator();
Object result = null;
- while(i.hasNext())
+ while (i.hasNext())
{
Object o = i.next();
if (o instanceof Exception)
{
- if (log.isDebugEnabled()) log.debug("Found remote exception among responses - removing from responses list", (Exception)o);
+ if (log.isDebugEnabled())
+ log.debug("Found remote exception among responses - removing from responses list", (Exception) o);
}
else
{
@@ -111,9 +112,9 @@
protected Map get0(Fqn name) throws Exception
{
- MethodCall call = MethodCallFactory.create(MethodDeclarations.getDataMapMethodLocal, new Object[]{name});
+ MethodCall call = MethodCallFactory.create(MethodDeclarations.getDataMapMethodLocal, name);
Object resp = callRemote(call);
- Map m = (Map)resp;
+ Map m = (Map) resp;
if (m != null)
{
// This eliminates a problem of seeing uninitialized nodes
@@ -124,15 +125,15 @@
public boolean exists(Fqn name) throws Exception
{
- MethodCall call = MethodCallFactory.create(MethodDeclarations.existsMethod, new Object[]{name});
+ MethodCall call = MethodCallFactory.create(MethodDeclarations.existsMethod, name);
Object resp = callRemote(call);
- return resp != null && ((Boolean) resp).booleanValue();
+ return resp != null && (Boolean) resp;
}
public Object put(Fqn name, Object key, Object value) throws Exception
{
- Object o[] = { name, key, Boolean.TRUE };
+ Object o[] = {name, key, true};
MethodCall call = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, o);
return callRemote(call);
}
More information about the jboss-cvs-commits
mailing list