[jbosscache-commits] JBoss Cache SVN: r6087 - searchable/trunk/src/main/java/org/jboss/cache/search.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Jun 27 07:39:56 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-06-27 07:39:56 -0400 (Fri, 27 Jun 2008)
New Revision: 6087

Modified:
   searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
   searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
   searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
Log:
Genericized

Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java	2008-06-27 11:29:56 UTC (rev 6086)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.java	2008-06-27 11:39:56 UTC (rev 6087)
@@ -4,15 +4,14 @@
 import org.jboss.cache.Cache;
 
 /**
- at author Navin Surtani  - navin at surtani.org
-
- This will be the most used interface in JBossCache searchable. It extends Cache and therefore will have
- the standard get(), put() and remove() methods. The additional method is the createQuery method which people
- will use to build their Hibernate Search queries from a luceneQuery - Hibernate Search users will be very familiar
- with this.
- 
+ * @author Navin Surtani  - navin at surtani.org
+ *         <p/>
+ *         This will be the most used interface in JBossCache searchable. It extends Cache and therefore will have
+ *         the standard get(), put() and remove() methods. The additional method is the createQuery method which people
+ *         will use to build their Hibernate Search queries from a luceneQuery - Hibernate Search users will be very familiar
+ *         with this.
  */
-public interface SearchableCache extends Cache
+public interface SearchableCache<K, V> extends Cache<K, V>
 {
 
    /**

Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java	2008-06-27 11:29:56 UTC (rev 6086)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFactory.java	2008-06-27 11:39:56 UTC (rev 6087)
@@ -8,7 +8,7 @@
 import java.util.Properties;
 
 /**
- at author Navin Surtani  - navin at surtani.org
+ * @author Navin Surtani  - navin at surtani.org
  */
 public class SearchableCacheFactory
 {
@@ -21,7 +21,7 @@
     * @param classes
     * @return
     */
-   public SearchableCache createSearchableCache (Cache c, Class...  classes)
+   public SearchableCache createSearchableCache(Cache<?, ?> c, Class... classes)
    {
       return createSearchableCache(c, null, classes);
    }
@@ -34,7 +34,7 @@
     * @param classes
     * @return
     */
-   public SearchableCache createSearchableCache (Cache c, Properties properties, Class...  classes)
+   public SearchableCache createSearchableCache(Cache<?, ?> c, Properties properties, Class... classes)
    {
       // assume cache is already created and running.
       // otherwise, start the cache!!

Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java	2008-06-27 11:29:56 UTC (rev 6086)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImpl.java	2008-06-27 11:39:56 UTC (rev 6087)
@@ -2,7 +2,6 @@
 
 import org.apache.lucene.search.Query;
 import org.hibernate.search.impl.SearchFactoryImpl;
-import org.hibernate.search.FullTextQuery;
 import org.jboss.cache.Cache;
 import org.jboss.cache.CacheException;
 import org.jboss.cache.CacheStatus;
@@ -23,14 +22,14 @@
  *         <p/>
  *         Implementation class for the SearchableCache interface.
  */
-public class SearchableCacheImpl implements SearchableCache
+public class SearchableCacheImpl<K, V> implements SearchableCache<K, V>
 {
    // this is the ACTUAL cache. that does all the work.
-   private Cache cache;
+   private Cache<K, V> cache;
    private SearchFactoryImpl searchFactory;
 
    //TODO: javadoc!!
-   public SearchableCacheImpl(Cache cache, SearchFactoryImpl searchFactory)
+   public SearchableCacheImpl(Cache<K, V> cache, SearchFactoryImpl searchFactory)
    {
       this.cache = cache;
       this.searchFactory = searchFactory;
@@ -73,17 +72,17 @@
       return cache.getCacheListeners();
    }
 
-   public Object put(String fqn, Object key, Object value)
+   public V put(String fqn, K key, V value)
    {
       return cache.put(fqn, key, value);
    }
 
-   public void put(String fqn, Map data)
+   public void put(String fqn, Map<K, V> data)
    {
       cache.put(fqn, data);
    }
 
-   public Object remove(String fqn, Object key)
+   public V remove(String fqn, K key)
    {
       return cache.remove(fqn, key);
    }
@@ -98,7 +97,7 @@
       return cache.getNode(fqn);
    }
 
-   public Object get(String fqn, Object key)
+   public V get(String fqn, K key)
    {
       return cache.get(fqn, key);
    }
@@ -158,7 +157,7 @@
       return cache.getVersion();
    }
 
-   public Set getKeys(String fqn)
+   public Set<K> getKeys(String fqn)
    {
       return cache.getKeys(fqn);
    }
@@ -168,77 +167,77 @@
       cache.clearData(fqn);
    }
 
-   public void clearData(Fqn fqn)
+   public void clearData(Fqn<?> fqn)
    {
       cache.clearData(fqn);
    }
 
-   public Set getKeys(Fqn fqn)
+   public Set getKeys(Fqn<?> fqn)
    {
       return cache.getKeys(fqn);
    }
 
-   public Map getData(Fqn fqn)
+   public Map getData(Fqn<?> fqn)
    {
       return cache.getData(fqn);
    }
 
-   public void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException
+   public void move(Fqn<?> nodeToMove, Fqn<?> newParent) throws NodeNotExistsException
    {
       cache.move(nodeToMove, newParent);
    }
 
-   public boolean removeRegion(Fqn fqn)
+   public boolean removeRegion(Fqn<?> fqn)
    {
       return cache.removeRegion(fqn);
    }
 
-   public Region getRegion(Fqn fqn, boolean createIfAbsent)
+   public Region getRegion(Fqn<?> fqn, boolean createIfAbsent)
    {
       return cache.getRegion(fqn, createIfAbsent);
    }
 
-   public void evict(Fqn fqn)
+   public void evict(Fqn<?> fqn)
    {
       cache.evict(fqn);
    }
 
-   public void evict(Fqn fqn, boolean recursive)
+   public void evict(Fqn<?> fqn, boolean recursive)
    {
       cache.evict(fqn, recursive);
    }
 
-   public Object get(Fqn fqn, Object key)
+   public V get(Fqn<?> fqn, K key)
    {
       return cache.get(fqn, key);
    }
 
-   public Node getNode(Fqn fqn)
+   public Node getNode(Fqn<?> fqn)
    {
       return cache.getNode(fqn);
    }
 
-   public boolean removeNode(Fqn fqn)
+   public boolean removeNode(Fqn<?> fqn)
    {
       return cache.removeNode(fqn);
    }
 
-   public Object remove(Fqn fqn, Object key)
+   public V remove(Fqn<?> fqn, K key)
    {
       return cache.remove(fqn, key);
    }
 
-   public void put(Fqn fqn, Map data)
+   public void put(Fqn<?> fqn, Map<K, V> data)
    {
       cache.put(fqn, data);
    }
 
-   public void putForExternalRead(Fqn fqn, Object key, Object value)
+   public void putForExternalRead(Fqn<?> fqn, K key, V value)
    {
       cache.putForExternalRead(fqn, key, value);
    }
 
-   public Object put(Fqn fqn, Object key, Object value)
+   public V put(Fqn<?> fqn, K key, V value)
    {
       return cache.put(fqn, key, value);
    }




More information about the jbosscache-commits mailing list