[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 14:48:44 EST 2006
User: msurtani
Date: 06/12/30 14:48:44
Modified: src/org/jboss/cache/loader
JDBCCacheLoaderConfig.java CacheLoader.java
AsynchCacheLoaderConfig.java
AbstractCacheLoader.java JDBCCacheLoader.java
ClusteredCacheLoader.java
FileCacheLoaderConfig.java
RpcDelegatingCacheLoader.java
ChainingCacheLoader.java
ClusteredCacheLoaderConfig.java
Log:
Genericised, autoboxed
Revision Changes Path
1.2 +41 -39 JBossCache/src/org/jboss/cache/loader/JDBCCacheLoaderConfig.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JDBCCacheLoaderConfig.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/JDBCCacheLoaderConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- JDBCCacheLoaderConfig.java 26 Oct 2006 19:30:20 -0000 1.1
+++ JDBCCacheLoaderConfig.java 30 Dec 2006 19:48:44 -0000 1.2
@@ -1,12 +1,14 @@
package org.jboss.cache.loader;
-import java.util.Properties;
-
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import java.util.Properties;
+
public class JDBCCacheLoaderConfig extends IndividualCacheLoaderConfig
{
- /** The serialVersionUID */
+ /**
+ * The serialVersionUID
+ */
private static final long serialVersionUID = -5923661816427361643L;
private boolean createTable;
@@ -269,9 +271,9 @@
}
String prop = props.getProperty("cache.jdbc.table.create");
- this.createTable = (prop == null || Boolean.valueOf(prop).booleanValue());
+ this.createTable = (prop == null || Boolean.valueOf(prop));
prop = props.getProperty("cache.jdbc.table.drop");
- this.dropTable = (prop == null || Boolean.valueOf(prop).booleanValue());
+ this.dropTable = (prop == null || Boolean.valueOf(prop));
this.table = props.getProperty("cache.jdbc.table.name", "jbosscache");
String primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
1.13 +3 -3 JBossCache/src/org/jboss/cache/loader/CacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/CacheLoader.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- CacheLoader.java 30 Dec 2006 17:50:01 -0000 1.12
+++ CacheLoader.java 30 Dec 2006 19:48:44 -0000 1.13
@@ -80,7 +80,7 @@
* @return Set a set of children. Returns null if no children nodes are
* present, or the parent is not present
*/
- Set getChildrenNames(Fqn fqn) throws Exception;
+ Set<String> getChildrenNames(Fqn fqn) throws Exception;
/**
* Returns all keys and values from the persistent store, given a fully qualified name.
@@ -94,7 +94,7 @@
* null if the node is not found. If the node is found but has no
* attributes, this method returns an empty Map.
*/
- Map get(Fqn name) throws Exception;
+ Map<Object, Object> get(Fqn name) throws Exception;
/**
@@ -122,7 +122,7 @@
* @param name The fully qualified name of the node
* @param attributes A Map of attributes. Can be null
*/
- void put(Fqn name, Map attributes) throws Exception;
+ void put(Fqn name, Map<Object, Object> attributes) throws Exception;
/**
* Applies all modifications to the backend store.
1.2 +18 -18 JBossCache/src/org/jboss/cache/loader/AsynchCacheLoaderConfig.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsynchCacheLoaderConfig.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AsynchCacheLoaderConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- AsynchCacheLoaderConfig.java 26 Oct 2006 19:30:20 -0000 1.1
+++ AsynchCacheLoaderConfig.java 30 Dec 2006 19:48:44 -0000 1.2
@@ -1,12 +1,14 @@
package org.jboss.cache.loader;
-import java.util.Properties;
-
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import java.util.Properties;
+
public class AsynchCacheLoaderConfig extends IndividualCacheLoaderConfig
{
- /** The serialVersionUID */
+ /**
+ * The serialVersionUID
+ */
private static final long serialVersionUID = 5038037589485991681L;
private int batchSize = 100;
@@ -17,7 +19,6 @@
/**
* Default constructor.
- *
*/
public AsynchCacheLoaderConfig()
{
@@ -114,7 +115,7 @@
s = props.getProperty("cache.async.returnOld");
if (s != null)
{
- returnOld = Boolean.valueOf(s).booleanValue();
+ returnOld = Boolean.valueOf(s);
}
s = props.getProperty("cache.async.queueSize");
@@ -126,7 +127,7 @@
s = props.getProperty("cache.async.put");
if (s != null)
{
- useAsyncPut = Boolean.valueOf(s).booleanValue();
+ useAsyncPut = Boolean.valueOf(s);
}
}
@@ -156,5 +157,4 @@
}
-
}
\ No newline at end of file
1.13 +7 -9 JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AbstractCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/AbstractCacheLoader.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- AbstractCacheLoader.java 20 Nov 2006 07:33:14 -0000 1.12
+++ AbstractCacheLoader.java 30 Dec 2006 19:48:44 -0000 1.13
@@ -16,8 +16,6 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -33,7 +31,7 @@
protected CacheSPI cache;
protected RegionManager regionManager;
- public void put(Fqn fqn, Map attributes, boolean erase) throws Exception
+ public void put(Fqn fqn, Map<Object, Object> attributes, boolean erase) throws Exception
{
if (erase)
{
@@ -41,7 +39,7 @@
}
// JBCACHE-769 -- make a defensive copy
- Map attrs = (attributes == null ? null : new MapCopy(attributes));
+ Map<Object, Object> attrs = (attributes == null ? null : new MapCopy<Object, Object>(attributes));
put(fqn, attrs);
}
@@ -155,8 +153,8 @@
*/
protected void loadStateHelper(Fqn fqn, ObjectOutputStream out) throws Exception
{
- Map attrs;
- Set children_names;
+ Map<Object, Object> attrs;
+ Set<? extends Object> children_names;
String child_name;
Fqn tmp_fqn;
NodeData nd;
@@ -179,9 +177,9 @@
{
return;
}
- for (Iterator it = children_names.iterator(); it.hasNext();)
+ for (Object children_name : children_names)
{
- child_name = (String) it.next();
+ child_name = (String) children_name;
tmp_fqn = new Fqn(fqn, child_name);
loadStateHelper(tmp_fqn, out);
}
@@ -233,7 +231,7 @@
_move(newFqn, new Fqn(fqn, c));
}
// get data for node.
- Map data = get(fqn);
+ Map<Object, Object> data = get(fqn);
if (data != null) // if null, then the node never existed. Don't bother removing?
{
remove(fqn);
1.26 +3 -3 JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JDBCCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/JDBCCacheLoader.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- JDBCCacheLoader.java 20 Dec 2006 02:16:24 -0000 1.25
+++ JDBCCacheLoader.java 30 Dec 2006 19:48:44 -0000 1.26
@@ -79,7 +79,7 @@
*
* @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
* @author <a href="mailto:hmesha at novell.com">Hany Mesha </a>
- * @version <tt>$Revision: 1.25 $</tt>
+ * @version <tt>$Revision: 1.26 $</tt>
*/
public class JDBCCacheLoader extends AbstractCacheLoader
{
@@ -689,8 +689,8 @@
else
{
// a hack to handles the incomp. of SQL server jdbc driver prior to SQL SERVER 2005
- if (driverName != null && (driverName.indexOf("SQLSERVER") >= 0
- || driverName.indexOf("POSTGRESQL") >= 0))
+ if (driverName != null && (driverName.contains("SQLSERVER")
+ || driverName.contains("POSTGRESQL")))
{
ps.setNull(2, Types.LONGVARBINARY);
}
1.21 +1 -1 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.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- ClusteredCacheLoader.java 30 Dec 2006 17:50:01 -0000 1.20
+++ ClusteredCacheLoader.java 30 Dec 2006 19:48:44 -0000 1.21
@@ -97,7 +97,7 @@
// keep looping till we find a FOUND answer.
List<Boolean> clusteredGetResp = (List<Boolean>) o;
// found?
- if ((clusteredGetResp.get(0)).booleanValue())
+ if (clusteredGetResp.get(0))
{
result = clusteredGetResp.get(1);
break;
1.3 +11 -11 JBossCache/src/org/jboss/cache/loader/FileCacheLoaderConfig.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FileCacheLoaderConfig.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/FileCacheLoaderConfig.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- FileCacheLoaderConfig.java 23 Nov 2006 16:07:38 -0000 1.2
+++ FileCacheLoaderConfig.java 30 Dec 2006 19:48:44 -0000 1.3
@@ -1,10 +1,10 @@
package org.jboss.cache.loader;
-import java.util.Properties;
-
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.config.Dynamic;
+import java.util.Properties;
+
public class FileCacheLoaderConfig extends IndividualCacheLoaderConfig
{
private static final long serialVersionUID = 4626734068542420865L;
@@ -59,7 +59,7 @@
{
setLocation(props.getProperty("location"));
String prop = props.getProperty("check.character.portability");
- setCheckCharacterPortability((prop == null || Boolean.valueOf(prop).booleanValue()));
+ setCheckCharacterPortability((prop == null || Boolean.valueOf(prop)));
}
}
1.15 +2 -2 JBossCache/src/org/jboss/cache/loader/RpcDelegatingCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RpcDelegatingCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/RpcDelegatingCacheLoader.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- RpcDelegatingCacheLoader.java 30 Dec 2006 17:50:01 -0000 1.14
+++ RpcDelegatingCacheLoader.java 30 Dec 2006 19:48:44 -0000 1.15
@@ -34,7 +34,7 @@
* specified, it defaults to <tt>5000</tt>.
*
* @author Daniel Gredler
- * @version $Id: RpcDelegatingCacheLoader.java,v 1.14 2006/12/30 17:50:01 msurtani Exp $
+ * @version $Id: RpcDelegatingCacheLoader.java,v 1.15 2006/12/30 19:48:44 msurtani Exp $
*/
public class RpcDelegatingCacheLoader extends DelegatingCacheLoader
{
@@ -154,7 +154,7 @@
protected boolean delegateExists(Fqn name) throws Exception
{
Boolean exists = (Boolean) this.doMethodCall(METHOD_EXISTS, new Object[]{name});
- return exists != null && exists.booleanValue();
+ return exists != null && exists;
}
/**
1.14 +2 -2 JBossCache/src/org/jboss/cache/loader/ChainingCacheLoader.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ChainingCacheLoader.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ChainingCacheLoader.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- ChainingCacheLoader.java 14 Nov 2006 14:17:10 -0000 1.13
+++ ChainingCacheLoader.java 30 Dec 2006 19:48:44 -0000 1.14
@@ -8,9 +8,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
+import org.jboss.cache.RegionManager;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.RegionManager;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
1.2 +14 -12 JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoaderConfig.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClusteredCacheLoaderConfig.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/ClusteredCacheLoaderConfig.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ClusteredCacheLoaderConfig.java 26 Oct 2006 19:30:20 -0000 1.1
+++ ClusteredCacheLoaderConfig.java 30 Dec 2006 19:48:44 -0000 1.2
@@ -1,13 +1,15 @@
package org.jboss.cache.loader;
-import java.util.Properties;
-
-import org.jboss.cache.config.Dynamic;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.config.Dynamic;
+
+import java.util.Properties;
public class ClusteredCacheLoaderConfig extends IndividualCacheLoaderConfig
{
- /** The serialVersionUID */
+ /**
+ * The serialVersionUID
+ */
private static final long serialVersionUID = -3425487656984237468L;
@Dynamic
@@ -45,7 +47,7 @@
super.setProperties(props);
try
{
- timeout = Long.valueOf(props.getProperty("timeout")).longValue();
+ timeout = Long.valueOf(props.getProperty("timeout"));
}
catch (Exception e)
{
More information about the jboss-cvs-commits
mailing list