svn commit: r929808 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache: CacheLineTable.java JdbmRecordManager.java JdbmSerializer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r929808 - in /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache: CacheLineTable.java JdbmRecordManager.java JdbmSerializer.java

doogie-3
Author: doogie
Date: Thu Apr  1 04:25:52 2010
New Revision: 929808

URL: http://svn.apache.org/viewvc?rev=929808&view=rev
Log:
Import jdbm classes instead of referencing them directly.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmRecordManager.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmSerializer.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java?rev=929808&r1=929807&r2=929808&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java Thu Apr  1 04:25:52 2010
@@ -31,6 +31,10 @@ import java.util.Set;
 import javolution.util.FastList;
 import javolution.util.FastMap;
 
+import jdbm.RecordManager;
+import jdbm.htree.HTree;
+import jdbm.helper.FastIterator;
+
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.ObjectType;
 import org.ofbiz.base.util.UtilGenerics;
@@ -42,9 +46,9 @@ import org.ofbiz.base.util.collections.R
 public class CacheLineTable<K, V> implements Serializable {
 
     public static final String module = CacheLineTable.class.getName();
-    protected static transient jdbm.RecordManager jdbmMgr = null;
+    protected static transient RecordManager jdbmMgr = null;
 
-    protected transient jdbm.htree.HTree fileTable = null;
+    protected transient HTree fileTable = null;
     protected Map<K, CacheLine<V>> memoryTable = null;
     protected String fileStore = null;
     protected String cacheName = null;
@@ -77,7 +81,7 @@ public class CacheLineTable<K, V> implem
             }
             if (CacheLineTable.jdbmMgr != null) {
                 try {
-                    this.fileTable = jdbm.htree.HTree.createInstance(CacheLineTable.jdbmMgr);
+                    this.fileTable = HTree.createInstance(CacheLineTable.jdbmMgr);
                     CacheLineTable.jdbmMgr.setNamedObject(cacheName, this.fileTable.getRecid());
                     CacheLineTable.jdbmMgr.commit();
                 } catch (IOException e) {
@@ -96,7 +100,7 @@ public class CacheLineTable<K, V> implem
 
     @SuppressWarnings("unchecked")
     private void addAllFileTableValues(List<CacheLine<V>> values) throws IOException {
-        jdbm.helper.FastIterator iter = fileTable.values();
+        FastIterator iter = fileTable.values();
         Object value = iter.next();
         while (value != null) {
             values.add((CacheLine<V>) value);
@@ -106,7 +110,7 @@ public class CacheLineTable<K, V> implem
 
     @SuppressWarnings("unchecked")
     private void addAllFileTableKeys(Set<K> keys) throws IOException {
-        jdbm.helper.FastIterator iter = fileTable.keys();
+        FastIterator iter = fileTable.keys();
         Object key = null;
         while ((key = iter.next()) != null) {
             if (key instanceof ObjectType.NullObject) {
@@ -222,7 +226,7 @@ public class CacheLineTable<K, V> implem
         List<Map.Entry<K, ? extends CacheLine<V>>> list = FastList.newInstance();
         if (fileTable != null) {
             try {
-                jdbm.helper.FastIterator iter = fileTable.keys();
+                FastIterator iter = fileTable.keys();
                 Object key = iter.next();
                 while (key != null) {
                     CacheLine<V> value = UtilGenerics.cast(fileTable.get(key));
@@ -276,7 +280,7 @@ public class CacheLineTable<K, V> implem
                 this.fileTable = null;
 
                 // create a new table
-                this.fileTable = jdbm.htree.HTree.createInstance(CacheLineTable.jdbmMgr);
+                this.fileTable = HTree.createInstance(CacheLineTable.jdbmMgr);
                 CacheLineTable.jdbmMgr.setNamedObject(cacheName, this.fileTable.getRecid());
                 CacheLineTable.jdbmMgr.commit();
             } catch (IOException e) {

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmRecordManager.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmRecordManager.java?rev=929808&r1=929807&r2=929808&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmRecordManager.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmRecordManager.java Thu Apr  1 04:25:52 2010
@@ -20,19 +20,21 @@ package org.ofbiz.base.util.cache;
 
 import java.io.IOException;
 
+import jdbm.RecordManager;
 import jdbm.helper.Serializer;
+import jdbm.recman.BaseRecordManager;
 
 /**
  * Customer JDBM Record Manager
  *
  */
-public class JdbmRecordManager implements jdbm.RecordManager {
+public class JdbmRecordManager implements RecordManager {
 
-    protected jdbm.recman.BaseRecordManager manager = null;
-    protected jdbm.helper.Serializer serial = null;
+    protected BaseRecordManager manager = null;
+    protected Serializer serial = null;
 
     public JdbmRecordManager(String name) throws IOException {
-        manager = new jdbm.recman.BaseRecordManager(name);
+        manager = new BaseRecordManager(name);
         serial = new JdbmSerializer();
     }
 

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmSerializer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmSerializer.java?rev=929808&r1=929807&r2=929808&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmSerializer.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/JdbmSerializer.java Thu Apr  1 04:25:52 2010
@@ -20,6 +20,9 @@ package org.ofbiz.base.util.cache;
 
 import java.io.IOException;
 
+import jdbm.RecordManager;
+import jdbm.helper.Serializer;
+
 import org.ofbiz.base.util.UtilObject;
 
 /**
@@ -28,7 +31,7 @@ import org.ofbiz.base.util.UtilObject;
  *
  */
 @SuppressWarnings("serial")
-public class JdbmSerializer implements jdbm.helper.Serializer {
+public class JdbmSerializer implements Serializer {
 
     public byte[] serialize(Object o) throws IOException {
         return UtilObject.getBytes(o);