[jbosscache-commits] JBoss Cache SVN: r5959 - in core/trunk/src/main/java/org/jboss/cache: invocation and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Jun 5 06:39:57 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-06-05 06:39:56 -0400 (Thu, 05 Jun 2008)
New Revision: 5959

Modified:
   core/trunk/src/main/java/org/jboss/cache/Cache.java
   core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
Log:
* Updated Javadocs
* Removed cache listener manipulation methods that worked on specific regions as this was way too inefficient to implement properly.

Modified: core/trunk/src/main/java/org/jboss/cache/Cache.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Cache.java	2008-06-05 10:34:51 UTC (rev 5958)
+++ core/trunk/src/main/java/org/jboss/cache/Cache.java	2008-06-05 10:39:56 UTC (rev 5959)
@@ -103,15 +103,6 @@
    void addCacheListener(Object listener);
 
    /**
-    * Adds a {@link org.jboss.cache.notifications.annotation.CacheListener}-annotated object to a given region.  The object passed in needs to be properly annotated with the
-    * {@link org.jboss.cache.notifications.annotation.CacheListener} annotation otherwise an {@link org.jboss.cache.notifications.IncorrectCacheListenerException} will be thrown.
-    *
-    * @param region   region to add listener to
-    * @param listener listener to add
-    */
-   void addCacheListener(Fqn<?> region, Object listener);
-
-   /**
     * Removes a {@link org.jboss.cache.notifications.annotation.CacheListener}-annotated object from the cache.  The object passed in needs to be properly annotated with the
     * {@link org.jboss.cache.notifications.annotation.CacheListener} annotation otherwise an {@link org.jboss.cache.notifications.IncorrectCacheListenerException} will be thrown.
     *
@@ -120,15 +111,6 @@
    void removeCacheListener(Object listener);
 
    /**
-    * Removes a {@link org.jboss.cache.notifications.annotation.CacheListener}-annotated object from a given region.  The object passed in needs to be properly annotated with the
-    * {@link org.jboss.cache.notifications.annotation.CacheListener} annotation otherwise an {@link org.jboss.cache.notifications.IncorrectCacheListenerException} will be thrown.
-    *
-    * @param region   region from which to remove listener
-    * @param listener listener to remove
-    */
-   void removeCacheListener(Fqn<?> region, Object listener);
-
-   /**
     * Retrieves an immutable {@link List} of objects annotated as {@link org.jboss.cache.notifications.annotation.CacheListener}s attached to the cache.
     *
     * @return an immutable {@link List} of objects annotated as {@link org.jboss.cache.notifications.annotation.CacheListener}s attached to the cache.
@@ -136,13 +118,6 @@
    Set<Object> getCacheListeners();
 
    /**
-    * Retrieves an immutable {@link List} of objects annotated as {@link org.jboss.cache.notifications.annotation.CacheListener}s attached to a specific region.
-    *
-    * @return an immutable {@link List} of objects annotated as {@link org.jboss.cache.notifications.annotation.CacheListener}s attached to a specific region.
-    */
-   Set<Object> getCacheListeners(Fqn<?> region);
-
-   /**
     * Associates the specified value with the specified key for a {@link Node} in this cache.
     * If the {@link Node} previously contained a mapping for this key, the old value is replaced by the specified value.
     *
@@ -151,7 +126,7 @@
     * @param value value to be associated with the specified key.
     * @return previous value associated with specified key, or <code>null</code> if there was no mapping for key.
     *         A <code>null</code> return can also indicate that the Node previously associated <code>null</code> with the specified key, if the implementation supports null values.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state.
     */
    V put(Fqn<?> fqn, K key, V value);
 
@@ -163,7 +138,7 @@
     * @param value value to be associated with the specified key.
     * @return previous value associated with specified key, or <code>null</code> if there was no mapping for key.
     *         A <code>null</code> return can also indicate that the Node previously associated <code>null</code> with the specified key, if the implementation supports null values.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
 
    V put(String fqn, K key, V value);
@@ -201,14 +176,16 @@
     *
     * @param fqn  <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to copy the data to
     * @param data mappings to copy
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    void put(Fqn<?> fqn, Map<K, V> data);
 
    /**
     * Convenience method that takes a string representation of an Fqn.  Otherwise identical to {@link #put(Fqn, java.util.Map)}
     *
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @param fqn  String representation of the Fqn
+    * @param data data map to insert
+    * @throws IllegalStateException if the cache is not in a started state
     */
    void put(String fqn, Map<K, V> data);
 
@@ -220,14 +197,17 @@
     * @param fqn <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
     * @param key key whose mapping is to be removed from the Node
     * @return previous value associated with specified Node's key
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    V remove(Fqn<?> fqn, K key);
 
    /**
     * Convenience method that takes a string representation of an Fqn.  Otherwise identical to {@link #remove(Fqn, Object)}
     *
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @param fqn string representation of the Fqn to retrieve
+    * @param key key to remove
+    * @return old value removed, or null if the fqn does not exist
+    * @throws IllegalStateException if the cache is not in a started state
     */
    V remove(String fqn, K key);
 
@@ -236,14 +216,16 @@
     *
     * @param fqn {@link Node} to remove
     * @return true if the node was removed, false if the node was not found
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    boolean removeNode(Fqn<?> fqn);
 
    /**
     * Convenience method that takes a string representation of an Fqn.  Otherwise identical to {@link #removeNode(Fqn)}
     *
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @param fqn string representation of the Fqn to retrieve
+    * @return true if the node was found and removed, false otherwise
+    * @throws IllegalStateException if the cache is not in a started state
     */
    boolean removeNode(String fqn);
 
@@ -252,14 +234,16 @@
     *
     * @param fqn fqn of the node to retrieve
     * @return a Node object, or a null if the node does not exist.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    Node<K, V> getNode(Fqn<?> fqn);
 
    /**
     * Convenience method that takes a string representation of an Fqn.  Otherwise identical to {@link #getNode(Fqn)}
     *
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @param fqn string representation of the Fqn to retrieve
+    * @return node, or null if the node does not exist
+    * @throws IllegalStateException if the cache is not in a started state
     */
    Node<K, V> getNode(String fqn);
 
@@ -270,14 +254,17 @@
     * @param fqn <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
     * @param key key under which value is to be retrieved.
     * @return returns data held under specified key in {@link Node} denoted by specified Fqn.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    V get(Fqn<?> fqn, K key);
 
    /**
     * Convenience method that takes a string representation of an Fqn.  Otherwise identical to {@link #get(Fqn, Object)}
     *
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @param fqn string representation of the Fqn to retrieve
+    * @param key key to fetch
+    * @return value, or null if the fqn does not exist.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    V get(String fqn, K key);
 
@@ -286,7 +273,7 @@
     *
     * @param fqn       <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be evicted.
     * @param recursive evicts children as well
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    void evict(Fqn<?> fqn, boolean recursive);
 
@@ -294,7 +281,7 @@
     * Eviction call that evicts the specified {@link Node} from memory.  Not recursive.
     *
     * @param fqn <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be evicted.
-    * @throws IllegalStateException if {@link #getCacheStatus()} would not return {@link CacheStatus.STARTED}.
+    * @throws IllegalStateException if the cache is not in a started state
     */
    void evict(Fqn<?> fqn);
 

Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java	2008-06-05 10:34:51 UTC (rev 5958)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java	2008-06-05 10:39:56 UTC (rev 5959)
@@ -474,21 +474,6 @@
       return put(Fqn.fromString(fqn), key, value);
    }
 
-   public Set<Object> getCacheListeners(Fqn region)
-   {
-      throw new UnsupportedOperationException("Not implemented in this release");
-   }
-
-   public void removeCacheListener(Fqn region, Object listener)
-   {
-      throw new UnsupportedOperationException("Not implemented in this release");
-   }
-
-   public void addCacheListener(Fqn region, Object listener)
-   {
-      throw new UnsupportedOperationException("Not implemented in this release");
-   }
-
    /**
     * Retrieves a defensively copied data map of the underlying node.
     *




More information about the jbosscache-commits mailing list