[jboss-cvs] JBossCache/src/org/jboss/cache ...

Manik Surtani manik at jboss.org
Mon Jun 11 11:06:02 EDT 2007


  User: msurtani
  Date: 07/06/11 11:06:02

  Modified:    src/org/jboss/cache           Fqn.java CacheSPI.java
                        Node.java DefaultCacheFactory.java CacheImpl.java
                        ConsoleListener.java NodeSPI.java
                        TreeCacheView.java Cache.java NodeFactory.java
  Log:
  generics-related tweaks
  
  Revision  Changes    Path
  1.53      +1 -1      JBossCache/src/org/jboss/cache/Fqn.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Fqn.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Fqn.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -b -r1.52 -r1.53
  --- Fqn.java	23 May 2007 10:28:58 -0000	1.52
  +++ Fqn.java	11 Jun 2007 15:06:02 -0000	1.53
  @@ -58,7 +58,7 @@
    * Another way to look at it is that the "/" separarator is only parsed when it forms
    * part of a String passed in to Fqn.fromString() and not otherwise.
    *
  - * @version $Revision: 1.52 $
  + * @version $Revision: 1.53 $
    */
   @Immutable
   public class Fqn<E> implements Cloneable, Externalizable, Comparable<Fqn>
  
  
  
  1.36      +3 -3      JBossCache/src/org/jboss/cache/CacheSPI.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheSPI.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheSPI.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -b -r1.35 -r1.36
  --- CacheSPI.java	9 May 2007 18:42:14 -0000	1.35
  +++ CacheSPI.java	11 Jun 2007 15:06:02 -0000	1.36
  @@ -159,7 +159,7 @@
       * @param includeDeletedNodes if you intend to see nodes marked as deleted within the current tx, set this to true
       * @return a node if one exists or null
       */
  -   NodeSPI<K, V> peek(Fqn fqn, boolean includeDeletedNodes);
  +   NodeSPI<K, V> peek(Fqn<?> fqn, boolean includeDeletedNodes);
   
      /**
       * Used with buddy replication's data gravitation interceptor.  If marshalling is necessary, ensure that the cache is
  @@ -170,7 +170,7 @@
       * @param searchBuddyBackupSubtrees if true, buddy backup subtrees are searched and if false, they are not.
       * @return a GravitateResult which contains the data for the gravitation
       */
  -   GravitateResult gravitateData(Fqn fqn, boolean searchBuddyBackupSubtrees);
  +   GravitateResult gravitateData(Fqn<?> fqn, boolean searchBuddyBackupSubtrees);
   
      /**
       * Retrieves an instance of a {@link Marshaller}, which is capable of
  
  
  
  1.64      +4 -4      JBossCache/src/org/jboss/cache/Node.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Node.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Node.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -b -r1.63 -r1.64
  --- Node.java	26 Apr 2007 12:03:07 -0000	1.63
  +++ Node.java	11 Jun 2007 15:06:02 -0000	1.64
  @@ -90,7 +90,7 @@
       * @param f {@link Fqn} of the child node, relative to the current node.
       * @return the newly created node, or the existing node if one already exists.
       */
  -   Node<K, V> addChild(Fqn f);
  +   Node<K, V> addChild(Fqn<?> f);
   
      /**
       * Removes a child node specified by the given relative {@link Fqn}.
  @@ -100,7 +100,7 @@
       * @param f {@link Fqn} of the child node, relative to the current node.
       * @return true if the node was found and removed, false otherwise
       */
  -   boolean removeChild(Fqn f);
  +   boolean removeChild(Fqn<?> f);
   
      /**
       * Removes a child node specified by the given name.
  @@ -117,7 +117,7 @@
       * @param f {@link Fqn} of the child node
       * @return null if the child does not exist.
       */
  -   Node<K, V> getChild(Fqn f);
  +   Node<K, V> getChild(Fqn<?> f);
   
      /**
       * @param name name of the child
  @@ -259,5 +259,5 @@
       * @param f {@link Fqn} relative to the current node of the child you are testing the existence of.
       * @return true if the child node denoted by the relative {@link Fqn} passed in exists.
       */
  -   boolean hasChild(Fqn f);
  +   boolean hasChild(Fqn<?> f);
   }
  
  
  
  1.7       +0 -8      JBossCache/src/org/jboss/cache/DefaultCacheFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DefaultCacheFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/DefaultCacheFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- DefaultCacheFactory.java	12 Mar 2007 18:13:46 -0000	1.6
  +++ DefaultCacheFactory.java	11 Jun 2007 15:06:02 -0000	1.7
  @@ -21,14 +21,6 @@
      private static CacheFactory singleton = new DefaultCacheFactory();
   
      /**
  -    * Protected constructor to prevent instantiation by user code
  -    */
  -   protected DefaultCacheFactory()
  -   {
  -      // protected constructor to prevent instantiation
  -   }
  -
  -   /**
       * @return a singleton instance of this class.
       */
      public static <K, V> CacheFactory<K, V> getInstance()
  
  
  
  1.87      +61 -55    JBossCache/src/org/jboss/cache/CacheImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -b -r1.86 -r1.87
  --- CacheImpl.java	11 Jun 2007 12:58:16 -0000	1.86
  +++ CacheImpl.java	11 Jun 2007 15:06:02 -0000	1.87
  @@ -578,10 +578,10 @@
         configureLogCategory();
   
         // initialise the node factory and set this in the runtime.
  -      NodeFactory nf;
  +      NodeFactory<K, V> nf;
         if ((nf = configuration.getRuntimeConfig().getNodeFactory()) == null)
         {
  -         nf = new NodeFactory(this);
  +         nf = new NodeFactory<K, V>(this);
            configuration.getRuntimeConfig().setNodeFactory(nf);
         }
         else
  @@ -1117,13 +1117,13 @@
       * Creates a subtree in the local cache.
       * Returns the DataNode created.
       */
  -   protected Node createSubtreeRootNode(Fqn subtree) throws CacheException
  +   protected Node createSubtreeRootNode(Fqn<?> subtree) throws CacheException
      {
         NodeSPI<K, V> parent = root;
         NodeSPI<K, V> child = null;
         Object owner = getOwnerForLock();
         Object name;
  -      NodeFactory factory = configuration.getRuntimeConfig().getNodeFactory();
  +      NodeFactory<K, V> factory = configuration.getRuntimeConfig().getNodeFactory();
   
         for (int i = 0; i < subtree.size(); i++)
         {
  @@ -1179,7 +1179,7 @@
       *                portion of the cache that should be evicted.
       * @throws CacheException
       */
  -   protected void _evictSubtree(Fqn subtree) throws CacheException
  +   protected void _evictSubtree(Fqn<?> subtree) throws CacheException
      {
   
         if (!exists(subtree))
  @@ -1198,7 +1198,8 @@
         {
            for (Object s : children)
            {
  -            Fqn tmp = new Fqn(subtree, s);
  +
  +            Fqn<Object> tmp = new Fqn<Object>(subtree, s);
               _remove(null, // no tx
                       tmp,
                       false, // no undo ops
  @@ -1315,7 +1316,7 @@
       *
       * @param fqn name of the DataNode to retreive
       */
  -   public Node<K, V> get(Fqn fqn) throws CacheException
  +   public Node<K, V> get(Fqn<?> fqn) throws CacheException
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.getNodeMethodLocal, fqn);
         return (Node<K, V>) invokeMethod(m, true);
  @@ -1324,7 +1325,7 @@
      /**
       * Returns the raw data of the node; called externally internally.
       */
  -   public Node<K, V> _get(Fqn fqn) throws CacheException
  +   public Node<K, V> _get(Fqn<?> fqn) throws CacheException
      {
         return findNode(fqn);
      }
  @@ -1332,7 +1333,7 @@
      /**
       * Returns the raw data of the node; called externally internally.
       */
  -   public Map _getData(Fqn fqn)
  +   public Map _getData(Fqn<?> fqn)
      {
         NodeSPI n = findNode(fqn);
         if (n == null) return null;
  @@ -1358,14 +1359,14 @@
       *
       * @param fqn name of the node
       */
  -   public Set<K> getKeys(Fqn fqn) throws CacheException
  +   public Set<K> getKeys(Fqn<?> fqn) throws CacheException
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.getKeysMethodLocal, fqn);
         return (Set<K>) invokeMethod(m, true);
      }
   
   
  -   public Set _getKeys(Fqn fqn) throws CacheException
  +   public Set _getKeys(Fqn<?> fqn) throws CacheException
      {
         NodeSPI<K, V> n = findNode(fqn);
         if (n == null)
  @@ -1396,12 +1397,12 @@
       * @param fqn The fully qualified name of the node.
       * @param key The key.
       */
  -   public V get(Fqn fqn, K key) throws CacheException
  +   public V get(Fqn<?> fqn, K key) throws CacheException
      {
         return get(fqn, key, true);
      }
   
  -   public V _get(Fqn fqn, K key, boolean sendNodeEvent) throws CacheException
  +   public V _get(Fqn<?> fqn, K key, boolean sendNodeEvent) throws CacheException
      {
         InvocationContext ctx = getInvocationContext();
         if (log.isTraceEnabled())
  @@ -1421,7 +1422,7 @@
      }
   
   
  -   protected V get(Fqn fqn, K key, boolean sendNodeEvent) throws CacheException
  +   protected V get(Fqn<?> fqn, K key, boolean sendNodeEvent) throws CacheException
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal, fqn, key, sendNodeEvent);
         return (V) invokeMethod(m, true);
  @@ -1451,7 +1452,7 @@
       * @param fqn The fully qualified name of the node
       * @return boolean Whether or not the node exists
       */
  -   public boolean exists(Fqn fqn)
  +   public boolean exists(Fqn<?> fqn)
      {
         Node n = peek(fqn, false);
         return n != null;
  @@ -1462,7 +1463,7 @@
       *
       * @param fqn
       */
  -   public NodeSPI<K, V> peek(Fqn fqn, boolean includeDeletedNodes)
  +   public NodeSPI<K, V> peek(Fqn<?> fqn, boolean includeDeletedNodes)
      {
         if (fqn == null || fqn.size() == 0) return root;
         NodeSPI<K, V> n = root;
  @@ -1502,7 +1503,7 @@
       * @param key
       * @return boolean Whether or not the node exists
       */
  -   public boolean exists(Fqn fqn, Object key)
  +   public boolean exists(Fqn<?> fqn, Object key)
      {
         NodeSPI n = peek(fqn, false);
         return n != null && n.getKeysDirect().contains(key);
  @@ -1532,12 +1533,12 @@
       * @param fqn  The fully qualified name of the new node
       * @param data The new data. May be null if no data should be set in the node.
       */
  -   public void put(Fqn fqn, Map data) throws CacheException
  +   public void put(Fqn<?> fqn, Map<K, V> data) throws CacheException
      {
         put(fqn, data, false);
      }
   
  -   public void put(Fqn fqn, Map data, boolean erase) throws CacheException
  +   public void put(Fqn<?> fqn, Map<K, V> data, boolean erase) throws CacheException
      {
         GlobalTransaction tx = getCurrentTransaction();
         MethodCall m;
  @@ -1577,7 +1578,7 @@
       * @param value The value
       * @return Object The previous value (if any), if node was present
       */
  -   public V put(Fqn fqn, K key, V value) throws CacheException
  +   public V put(Fqn<?> fqn, K key, V value) throws CacheException
      {
         GlobalTransaction tx = getCurrentTransaction();
         MethodCall m = MethodCallFactory.create(MethodDeclarations.putKeyValMethodLocal, tx, fqn, key, value, true);
  @@ -1599,7 +1600,7 @@
       *
       * @param fqn The fully qualified name of the node.
       */
  -   public boolean remove(Fqn fqn) throws CacheException
  +   public boolean remove(Fqn<?> fqn) throws CacheException
      {
         GlobalTransaction tx = getCurrentTransaction();
         // special case if we are removing the root.  Remove all children instead.
  @@ -1612,7 +1613,7 @@
            for (Object childName : _getChildrenNames(fqn))
            {
               ctx.setOptionOverrides(o);
  -            result = remove(new Fqn(fqn, childName)) && result;
  +            result = remove(new Fqn<Object>(fqn, childName)) && result;
            }
   
            return result;
  @@ -1635,7 +1636,7 @@
       * @param fqn Will remove everythign assoicated with this fqn.
       * @throws CacheException
       */
  -   public void evict(Fqn fqn) throws CacheException
  +   public void evict(Fqn<?> fqn) throws CacheException
      {
         if (fqn.isRoot())
         {
  @@ -1646,7 +1647,7 @@
            for (Object childName : _getChildrenNames(fqn))
            {
               ctx.setOptionOverrides(o);
  -            evict(new Fqn(fqn, childName));
  +            evict(new Fqn<Object>(fqn, childName));
            }
         }
         else
  @@ -1675,7 +1676,7 @@
       * @param key The key to be removed
       * @return The previous value, or null if none was associated with the given key
       */
  -   public V remove(Fqn fqn, K key) throws CacheException
  +   public V remove(Fqn<?> fqn, K key) throws CacheException
      {
         GlobalTransaction tx = getCurrentTransaction();
         MethodCall m = MethodCallFactory.create(MethodDeclarations.removeKeyMethodLocal, tx, fqn, key, true);
  @@ -1693,7 +1694,7 @@
      /**
       * Removes the keys and properties from a named node.
       */
  -   public void removeData(Fqn fqn) throws CacheException
  +   public void removeData(Fqn<?> fqn) throws CacheException
      {
         GlobalTransaction tx = getCurrentTransaction();
         MethodCall m = MethodCallFactory.create(MethodDeclarations.removeDataMethodLocal, tx, fqn, true);
  @@ -1737,7 +1738,7 @@
      /**
       * Releases all locks for this node and the entire node subtree.
       */
  -   public void releaseAllLocks(Fqn fqn)
  +   public void releaseAllLocks(Fqn<?> fqn)
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.releaseAllLocksMethodLocal, fqn);
         try
  @@ -1763,7 +1764,7 @@
       * Prints a representation of the node defined by <code>fqn</code>.
       * Output includes name, fqn and data.
       */
  -   public String print(Fqn fqn)
  +   public String print(Fqn<?> fqn)
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.printMethodLocal, fqn);
         Object retval = null;
  @@ -1808,25 +1809,30 @@
       * @param fqn The fully qualified name of the node
       * @return Set an unmodifiable set of children names, Object.
       */
  -   public Set getChildrenNames(Fqn fqn) throws CacheException
  +   public <E> Set<E> getChildrenNames(Fqn<E> fqn) throws CacheException
      {
         MethodCall m = MethodCallFactory.create(MethodDeclarations.getChildrenNamesMethodLocal, fqn);
  -      Set retval = (Set) invokeMethod(m, true);
  -      return retval == null ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet(retval));
  +      Set<E> retval = null;
  +      retval = (Set<E>) invokeMethod(m, true);
  +      if (retval != null)
  +         retval = Collections.unmodifiableSet(new HashSet<E>(retval));
  +      else
  +         retval = Collections.emptySet();
  +      return retval;
      }
   
  -   public Set<Object> _getChildrenNames(Fqn fqn) throws CacheException
  +   public <E> Set<E> _getChildrenNames(Fqn<E> fqn) throws CacheException
      {
  -      NodeSPI n = findNode(fqn);
  +      NodeSPI<K, V> n = findNode(fqn);
         if (n == null) return null;
  -      Set<Object> s = n.getChildrenNamesDirect();
  +      Set<E> s = (Set<E>) n.getChildrenNamesDirect();
         return s;
      }
   
      /**
       * Returns true if the FQN exists and the node has children.
       */
  -   public boolean hasChild(Fqn fqn)
  +   public boolean hasChild(Fqn<?> fqn)
      {
         if (fqn == null) return false;
   
  @@ -1969,7 +1975,7 @@
       *
       * @see #getNumberOfAttributes
       */
  -   public int getNumberOfAttributes(Fqn fqn)
  +   public int getNumberOfAttributes(Fqn<?> fqn)
      {
         return numAttributes(findNode(fqn));
      }
  @@ -2666,7 +2672,7 @@
       *         to the presence of children
       * @throws CacheException
       */
  -   public boolean _evict(Fqn fqn) throws CacheException
  +   public boolean _evict(Fqn<?> fqn) throws CacheException
      {
         if (!exists(fqn))
            return true;// node does not exist. Maybe it has been recursively removed.
  @@ -2700,7 +2706,7 @@
       *         to the presence of children
       * @throws CacheException
       */
  -   public boolean _evict(Fqn fqn, DataVersion version) throws CacheException
  +   public boolean _evict(Fqn<?> fqn, DataVersion version) throws CacheException
      {
         if (!exists(fqn))
            return true;// node does not exist
  @@ -2868,7 +2874,7 @@
       * @param searchSubtrees if true, buddy backup subtrees are searched and if false, they are not.
       * @return a GravitateResult which contains the data for the gravitation
       */
  -   public GravitateResult gravitateData(Fqn fqn, boolean searchSubtrees)
  +   public GravitateResult gravitateData(Fqn<?> fqn, boolean searchSubtrees)
              throws CacheException
      {
         // we need to get the state for this Fqn and its sub-nodes.
  @@ -3017,7 +3023,7 @@
      /**
       * Releases all locks for a FQN.
       */
  -   public void _releaseAllLocks(Fqn fqn)
  +   public void _releaseAllLocks(Fqn<?> fqn)
      {
         NodeSPI<K, V> n;
   
  @@ -3051,7 +3057,7 @@
       * Finds and returns the string value for the Fqn.
       * Returns null if not found or upon error.
       */
  -   public String _print(Fqn fqn)
  +   public String _print(Fqn<?> fqn)
      {
         try
         {
  @@ -3068,7 +3074,7 @@
      /**
       * Should not be called.
       */
  -   public void _lock(Fqn fqn, NodeLock.LockType lock_type, boolean recursive)
  +   public void _lock(Fqn<?> fqn, NodeLock.LockType lock_type, boolean recursive)
              throws TimeoutException, LockingException
      {
         throw new UnsupportedOperationException("method _lock() should not be invoked on CacheImpl");
  @@ -3167,7 +3173,7 @@
       *
       * @since 2.0.0
       */
  -   public void move(Fqn nodeToMove, Fqn newParent)
  +   public void move(Fqn<?> nodeToMove, Fqn<?> newParent)
      {
         // this needs to be passed up the interceptor chain
         MethodCall m = MethodCallFactory.create(MethodDeclarations.moveMethodLocal, nodeToMove, newParent);
  @@ -3180,7 +3186,7 @@
       * @param newParentFqn
       * @param nodeToMoveFqn
       */
  -   public void _move(Fqn nodeToMoveFqn, Fqn newParentFqn)
  +   public void _move(Fqn<?> nodeToMoveFqn, Fqn newParentFqn)
      {
         // the actual move algorithm.
         NodeSPI<K, V> newParent = findNode(newParentFqn);
  @@ -3888,7 +3894,7 @@
       * @param fqn Fully qualified name for the corresponding node.
       * @return DataNode
       */
  -   public NodeSPI<K, V> findNode(Fqn fqn)
  +   public NodeSPI<K, V> findNode(Fqn<?> fqn)
      {
         try
         {
  @@ -3922,7 +3928,7 @@
       *
       * @param f
       */
  -   public boolean realRemove(Fqn f, boolean skipMarkerCheck)
  +   public boolean realRemove(Fqn<?> f, boolean skipMarkerCheck)
      {
         NodeSPI n = peek(f, true);
         if (n == null)
  @@ -3956,7 +3962,7 @@
      /**
       * Finds a node given a fully qualified name and DataVersion.
       */
  -   private NodeSPI<K, V> findNode(Fqn fqn, DataVersion version) throws CacheException
  +   private NodeSPI<K, V> findNode(Fqn<?> fqn, DataVersion version) throws CacheException
      {
         if (fqn == null) return null;
   
  @@ -4175,7 +4181,7 @@
         getNotifier().addCacheListener(l);
      }
   
  -   public void addCacheListener(Fqn region, CacheListener l)
  +   public void addCacheListener(Fqn<?> region, CacheListener l)
      {
         throw new UnsupportedOperationException("Not implemented in this release");
      }
  @@ -4189,7 +4195,7 @@
            n.removeCacheListener(l);
      }
   
  -   public void removeCacheListener(Fqn region, CacheListener l)
  +   public void removeCacheListener(Fqn<?> region, CacheListener l)
      {
         throw new UnsupportedOperationException("Not implemented in this release");
      }
  @@ -4199,7 +4205,7 @@
         return getNotifier().getCacheListeners();
      }
   
  -   public Set<CacheListener> getCacheListeners(Fqn region)
  +   public Set<CacheListener> getCacheListeners(Fqn<?> region)
      {
         throw new UnsupportedOperationException("Not implemented in this release");
      }
  @@ -4235,7 +4241,7 @@
         return getConfiguration().getClusterName();
      }
   
  -   public void evict(Fqn fqn, boolean recursive)
  +   public void evict(Fqn<?> fqn, boolean recursive)
      {
         if (recursive)
         {
  @@ -4260,22 +4266,22 @@
         evict(n.getFqn());
      }
   
  -   public Region getRegion(Fqn fqn, boolean createIfAbsent)
  +   public Region getRegion(Fqn<?> fqn, boolean createIfAbsent)
      {
         return getRegionManager().getRegion(fqn, createIfAbsent);
      }
   
  -   public boolean removeRegion(Fqn fqn)
  +   public boolean removeRegion(Fqn<?> fqn)
      {
         return getRegionManager().removeRegion(fqn);
      }
   
  -   public boolean removeNode(Fqn fqn)
  +   public boolean removeNode(Fqn<?> fqn)
      {
         return remove(fqn);
      }
   
  -   public void putForExternalRead(Fqn fqn, K key, V value)
  +   public void putForExternalRead(Fqn<?> fqn, K key, V value)
      {
         // if the node exists then this should be a no-op.
         if (!exists(fqn))
  
  
  
  1.17      +7 -7      JBossCache/src/org/jboss/cache/ConsoleListener.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConsoleListener.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/ConsoleListener.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- ConsoleListener.java	30 May 2007 11:35:15 -0000	1.16
  +++ ConsoleListener.java	11 Jun 2007 15:06:02 -0000	1.17
  @@ -19,7 +19,7 @@
    *
    * @author Jimmy Wilson 12-2004
    */
  -public class ConsoleListener implements CacheListener
  +public class ConsoleListener extends AbstractCacheListener
   {
      private CacheImpl _cache;
      private boolean _startCache;
  @@ -184,7 +184,7 @@
         }
      }
   
  -   public void nodeActivated(Fqn fqn, boolean pre, Map<Object, Object> data)
  +   public void nodeActivated(Fqn fqn, boolean pre, Map data)
      {
         if (pre)
         {
  @@ -196,7 +196,7 @@
         }
      }
   
  -   public void nodePassivated(Fqn fqn, boolean pre, Map<Object, Object> data)
  +   public void nodePassivated(Fqn fqn, boolean pre, Map data)
      {
         if (pre)
         {
  
  
  
  1.20      +1 -1      JBossCache/src/org/jboss/cache/NodeSPI.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeSPI.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/NodeSPI.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- NodeSPI.java	23 May 2007 15:22:05 -0000	1.19
  +++ NodeSPI.java	11 Jun 2007 15:06:02 -0000	1.20
  @@ -114,7 +114,7 @@
       *
       * @param f fqn to set
       */
  -   void setFqn(Fqn f);
  +   void setFqn(Fqn<?> f);
   
      /**
       * Returns true if the instance has been deleted in the current transaction.
  
  
  
  1.27      +34 -35    JBossCache/src/org/jboss/cache/TreeCacheView.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheView.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheView.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -b -r1.26 -r1.27
  --- TreeCacheView.java	4 Jun 2007 22:54:52 -0000	1.26
  +++ TreeCacheView.java	11 Jun 2007 15:06:02 -0000	1.27
  @@ -56,7 +56,7 @@
    * data needs to be displayed, the underlying cache will be accessed directly.
    *
    * @author Bela Ban
  - * @version $Revision: 1.26 $
  + * @version $Revision: 1.27 $
    */
   public class TreeCacheView implements TreeCacheViewMBean
   {
  @@ -115,7 +115,6 @@
      }
      
      
  -
      public Cache getCache()
      {
         return cache;
  @@ -594,11 +593,11 @@
      {
      }
   
  -   public void nodeActivated(Fqn fqn, boolean pre, Map<Object, Object> data)
  +   public void nodeActivated(Fqn fqn, boolean pre, Map data)
      {
      }
   
  -   public void nodePassivated(Fqn fqn, boolean pre, Map<Object, Object> data)
  +   public void nodePassivated(Fqn fqn, boolean pre, Map data)
      {
      }
   
  
  
  
  1.29      +15 -15    JBossCache/src/org/jboss/cache/Cache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Cache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Cache.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- Cache.java	23 May 2007 18:17:21 -0000	1.28
  +++ Cache.java	11 Jun 2007 15:06:02 -0000	1.29
  @@ -107,7 +107,7 @@
       * @param region
       * @param l
       */
  -   void addCacheListener(Fqn region, CacheListener l);
  +   void addCacheListener(Fqn<?> region, CacheListener l);
   
      /**
       * Removes a {@link CacheListener} from the cache
  @@ -122,7 +122,7 @@
       * @param region
       * @param l
       */
  -   void removeCacheListener(Fqn region, CacheListener l);
  +   void removeCacheListener(Fqn<?> region, CacheListener l);
   
      /**
       * Retrieves an immutable {@link List} of {@link CacheListener}s attached to the cache.
  @@ -136,7 +136,7 @@
       *
       * @return an immutable {@link List} of {@link CacheListener}s attached to a specific region.
       */
  -   Set<CacheListener> getCacheListeners(Fqn region);
  +   Set<CacheListener> getCacheListeners(Fqn<?> region);
   
      /**
       * Associates the specified value with the specified key for a {@link Node} in this cache.
  @@ -148,7 +148,7 @@
       * @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.
       */
  -   V put(Fqn fqn, K key, V value);
  +   V put(Fqn<?> fqn, K key, V value);
   
      /**
       * Under special operating behavior, associates the value with the specified key for a node identified by the Fqn passed in.
  @@ -174,7 +174,7 @@
       * @param key   key with which the specified value is to be associated.
       * @param value value to be associated with the specified key.
       */
  -   void putForExternalRead(Fqn fqn, K key, V value);
  +   void putForExternalRead(Fqn<?> fqn, K key, V value);
   
      /**
       * Copies all of the mappings from the specified map to a {@link Node}.
  @@ -182,7 +182,7 @@
       * @param fqn  <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to copy the data to
       * @param data mappings to copy
       */
  -   void put(Fqn fqn, Map<K, V> data);
  +   void put(Fqn<?> fqn, Map<K, V> data);
   
      /**
       * Removes the mapping for this key from a Node.
  @@ -193,7 +193,7 @@
       * @param key key whose mapping is to be removed from the Node
       * @return previous value associated with specified Node's key
       */
  -   V remove(Fqn fqn, K key);
  +   V remove(Fqn<?> fqn, K key);
   
      /**
       * Removes a {@link Node} indicated by absolute {@link Fqn}.
  @@ -201,7 +201,7 @@
       * @param fqn {@link Node} to remove
       * @return true if the node was removed, false if the node was not found
       */
  -   boolean removeNode(Fqn fqn);
  +   boolean removeNode(Fqn<?> fqn);
   
      /**
       * Convenience method that allows for direct access to the data in a {@link Node}.
  @@ -210,7 +210,7 @@
       * @param key key under which value is to be retrieved.
       * @return returns data held under specified key in {@link Node} denoted by specified Fqn.
       */
  -   V get(Fqn fqn, K key);
  +   V get(Fqn<?> fqn, K key);
   
      /**
       * Eviction call that evicts the specified {@link Node} from memory.
  @@ -218,7 +218,7 @@
       * @param fqn       <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be evicted.
       * @param recursive evicts children as well
       */
  -   void evict(Fqn fqn, boolean recursive);
  +   void evict(Fqn<?> fqn, boolean recursive);
   
      /**
       * Retrieves a {@link Region} for a given {@link Fqn}.  If the region does not exist,
  @@ -233,7 +233,7 @@
       * @throws UnsupportedOperationException if the region cannot be defined.
       * @see Region
       */
  -   Region getRegion(Fqn fqn, boolean createIfAbsent);
  +   Region getRegion(Fqn<?> fqn, boolean createIfAbsent);
   
      /**
       * Removes a region denoted by the Fqn passed in.
  @@ -241,7 +241,7 @@
       * @param fqn of the region to remove
       * @return true if a region did exist and was removed; false otherwise.
       */
  -   boolean removeRegion(Fqn fqn);
  +   boolean removeRegion(Fqn<?> fqn);
   
      /**
       * Lifecycle method that initializes configuration state, the root node, etc.
  @@ -354,7 +354,7 @@
       * @param newParent  new location under which to attach the node being moved.
       * @throws NodeNotExistsException may throw one of these if the target node does not exist or if a different thread has moved this node elsewhere already.
       */
  -   void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException;
  +   void move(Fqn<?> nodeToMove, Fqn<?> newParent) throws NodeNotExistsException;
   
      /**
       * Returns the version of the cache as a string.
  
  
  
  1.3       +12 -12    JBossCache/src/org/jboss/cache/NodeFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/NodeFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- NodeFactory.java	19 Jan 2007 02:04:11 -0000	1.2
  +++ NodeFactory.java	11 Jun 2007 15:06:02 -0000	1.3
  @@ -17,20 +17,20 @@
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  -public class NodeFactory
  +public class NodeFactory<K, V>
   {
      public enum NodeType
      {
         UNVERSIONED_NODE, VERSIONED_NODE, WORKSPACE_NODE
      }
   
  -   private CacheSPI cache;
  +   private CacheSPI<K, V> cache;
      private boolean optimistic;
   
      /**
       * Constructs an instance of the factory
       */
  -   public NodeFactory(CacheSPI cache)
  +   public NodeFactory(CacheSPI<K, V> cache)
      {
         this.cache = cache;
         init();
  @@ -58,35 +58,35 @@
       *                  should be copied into the new node's data field.
       * @return the new node
       */
  -   public NodeSPI createDataNode(Object childName, Fqn fqn, NodeSPI parent, Map data, boolean mapSafe)
  +   public NodeSPI<K, V> createDataNode(Object childName, Fqn fqn, NodeSPI<K, V> parent, Map<K, V> data, boolean mapSafe)
      {
  -      return optimistic ? new VersionedNode(fqn, parent, data, cache) : new UnversionedNode(childName, fqn, data, mapSafe, cache);
  +      return optimistic ? new VersionedNode<K, V>(fqn, parent, data, cache) : new UnversionedNode<K, V>(childName, fqn, data, mapSafe, cache);
      }
   
  -   public Node createNode(Object childName, Node parent, Map data)
  +   public Node<K, V> createNode(Object childName, Node<K, V> parent, Map<K, V> data)
      {
         return createNodeOfType(parent, childName, parent, data);
      }
   
  -   public Node createNodeOfType(Node template, Object childName, Node parent, Map data)
  +   public Node<K, V> createNodeOfType(Node<K, V> template, Object childName, Node<K, V> parent, Map<K, V> data)
      {
         if (template instanceof WorkspaceNode)
         {
  -         NodeSPI dataNodeParent = ((WorkspaceNode) parent).getNode();
  +         NodeSPI<K, V> dataNodeParent = ((WorkspaceNode<K, V>) parent).getNode();
            TransactionWorkspace workspace = ((WorkspaceNode) template).getTransactionWorkspace();
            return createWorkspaceNode(dataNodeParent, workspace);
         }
   
         // not a workspace node.
  -      return createDataNode(childName, new Fqn(parent.getFqn(), childName), (NodeSPI) parent, data, false);
  +      return createDataNode(childName, new Fqn(parent.getFqn(), childName), (NodeSPI<K, V>) parent, data, false);
      }
   
  -   public WorkspaceNode createWorkspaceNode(NodeSPI dataNode, TransactionWorkspace workspace)
  +   public WorkspaceNode<K, V> createWorkspaceNode(NodeSPI<K, V> dataNode, TransactionWorkspace workspace)
      {
  -      return new WorkspaceNodeImpl(dataNode, workspace);
  +      return new WorkspaceNodeImpl<K, V>(dataNode, workspace);
      }
   
  -   public NodeSPI createRootDataNode()
  +   public NodeSPI<K, V> createRootDataNode()
      {
         return createDataNode(null, Fqn.ROOT, null, null, false);
      }
  
  
  



More information about the jboss-cvs-commits mailing list