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

Elias Ross genman at noderunner.net
Thu Jan 18 21:04:11 EST 2007


  User: genman  
  Date: 07/01/18 21:04:11

  Modified:    src/org/jboss/cache                     
                        BatchModeTransactionManagerLookup.java Cache.java
                        CacheFactory.java CacheListener.java
                        DefaultCacheFactory.java
                        DummyTransactionManagerLookup.java Fqn.java
                        GenericTransactionManagerLookup.java
                        JBossTransactionManagerLookup.java Node.java
                        NodeFactory.java NodeSPI.java Region.java
                        RegionManager.java RegionNotEmptyException.java
                        TransactionEntry.java TransactionManagerLookup.java
                        TransactionTable.java TreeCacheView.java
                        Version.java VersionedNode.java
  Log:
  JBCACHE-939 - Clean up JavaDoc, first pass
  
  Revision  Changes    Path
  1.2       +2 -2      JBossCache/src/org/jboss/cache/BatchModeTransactionManagerLookup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BatchModeTransactionManagerLookup.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/BatchModeTransactionManagerLookup.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- BatchModeTransactionManagerLookup.java	31 Mar 2005 10:14:59 -0000	1.1
  +++ BatchModeTransactionManagerLookup.java	19 Jan 2007 02:04:09 -0000	1.2
  @@ -6,10 +6,10 @@
   
   
   /**
  - * Returns an instance of DummyTransactionManager, used by standalone cache.
  + * Returns an instance of {@link BatchModeTransactionManager}.
    *
    * @author Bela Ban Sept 5 2003
  - * @version $Id: BatchModeTransactionManagerLookup.java,v 1.1 2005/03/31 10:14:59 belaban Exp $
  + * @version $Id: BatchModeTransactionManagerLookup.java,v 1.2 2007/01/19 02:04:09 genman Exp $
    */
   public class BatchModeTransactionManagerLookup implements TransactionManagerLookup {
   
  
  
  
  1.20      +54 -37    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.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- Cache.java	11 Jan 2007 13:49:07 -0000	1.19
  +++ Cache.java	19 Jan 2007 02:04:10 -0000	1.20
  @@ -14,10 +14,13 @@
   import java.util.Set;
   
   /**
  - * Along with {@link Node}, this is the central construct and basic client API of JBoss Cache and is used for
  + * Interface for a Cache where data mappings are grouped and stored in a tree data
  + * structure consisting of {@link Node}s. 
  + * This is the central construct and basic client API of JBoss Cache and is used for
    * cache-wide operations.
    * <p/>
  - * The cache is constructed using a {@link CacheFactory}.
  + * The cache is constructed using a {@link CacheFactory} and is started
  + * using {@link #start}, optionally preceeded by a call to @{link #create}.
    * <p/>
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  @@ -35,15 +38,14 @@
      Configuration getConfiguration();
   
      /**
  -    * Convenience method to return the default root as a {@link Node}.  The default root, represented by this
  -    * {@link Cache} instance, is a {@link Node} anyway though.
  +    * Returns the root node of this cache.
       *
  -    * @return the current {@link Cache} instance, as a {@link Node}
  +    * @return the root node
       */
      Node getRoot();
   
      /**
  -    * Adds a {@link CacheListener} to the entire cache
  +    * Adds a {@link CacheListener} to the entire cache.
       *
       * @param l listener to add
       */
  @@ -87,53 +89,56 @@
      Set<CacheListener> getCacheListeners(Fqn region);
   
      /**
  -    * Convenience method that allows for direct access to the data in a {@link Node}.
  +    * 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.
       *
       * @param fqn   <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
  -    * @param key
  -    * @param value
  -    * @return Returns the old value contained under this key.  Null if key doesn't exist.
  +    * @param key   key with which the specified value is to be associated.
  +    * @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.
       */
      Object put(Fqn fqn, Object key, Object value);
   
      /**
  -    * For use cases that have an external representation and storage of data objects, doing a put() in the cache
  -    * should not have as strong a set of semantics as though when the cache is in itself the main form of storing data.
  -    * <p/>
  -    * In these cases, a putForExternalRead() should be used instead of a put() - the key differences being:
  -    * <p/>
  +    * Under special operating behavior, associates the value with the specified key for a {@link Node}:
       * <ul>
       * <li> Ongoing transactions are suspended before this call, so failures here will not affect any ongoing transactions.</li>
  -    * <li> Errors and exceptions are 'silent' - logged at a muhc lower level than normal, and this method does not throw exceptions</li>
  +    * <li> Errors and exceptions are 'silent' - logged at a much lower level than normal, and this method does not throw exceptions</li>
       * <li> Lock acquisition timeouts are dropped to 0 to improve performance</li>
       * <li> If pessimistic locking is used, write locks are not obtained here - even though this is a write.  Instead, read locks are used.<li>
       * </ul>
  -    *
  -    * @param fqn
  -    * @param key
  -    * @param value
  +    * This method is for caching data that has an external representation in storage,
  +    * where, concurrent modification and transactions are not a consideration. 
  +    * <p/>
  +    * @param fqn   <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
  +    * @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, Object key, Object value);
   
      /**
  -    * Convenience method that allows for direct access to the data in a {@link Node}.
  +    * Copies all of the mappings from the specified map to a {@link Node}.
       *
  -    * @param fqn
  -    * @param data
  +    * @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 data);
   
      /**
  -    * Convenience method that allows for direct access to the data in a {@link Node}.
  +    * Removes the mapping for this key from a Node.
  +    * Returns the value to which the Node previously associated the key, or 
  +    * <code>null</code> if the Node contained no mapping for this key. 
       *
       * @param fqn <b><i>absolute</i></b> {@link Fqn} to the {@link Node} to be accessed.
  -    * @param key
  -    * @return Returns the old value contained under this key.  Null if key doesn't exist.
  +    * @param key key whose mapping is to be removed from the Node
  +    * @return previous value associated with specified Node's key
       */
      Object remove(Fqn fqn, Object key);
   
      /**
  -    * Removes a node based on the (absolute) Fqn passed in.
  +    * Removes a {@link Node} indicated by absolute {@link Fqn}.
  +    * @param fqn {@link Node} to remove
       */
      void removeNode(Fqn fqn);
   
  @@ -169,22 +174,25 @@
      Region getRegion(Fqn fqn, boolean createIfAbsent);
   
      /**
  -    * Lifecycle method
  +    * Lifecycle method that initializes configuration state, the root node, etc.
       */
      void create() throws Exception;
   
      /**
  -    * Lifecycle method
  +    * Lifecycle method that starts the cache loader, 
  +    * starts cache replication, starts the region manager, etc.
       */
      void start() throws Exception;
   
      /**
  -    * Lifecycle method
  +    * Lifecycle method that stops the cache, including replication,
  +    * clustering, cache loading, notifications, etc. 
       */
      void stop();
   
      /**
  -    * Lifecycle method
  +    * Lifecycle method that clears state.
  +    * Cache can then be restarted using {@link #start}.
       */
      void destroy();
   
  @@ -198,17 +206,23 @@
      /**
       * Sets the passed in {@link org.jboss.cache.InvocationContext} as current.
       *
  -    * @param ctx
  +    * @param ctx invocation context to use
       */
      void setInvocationContext(InvocationContext ctx);
   
      /**
  -    * @return the local address of this cache in a cluster.  Null if running in local mode.
  +    * Returns the local address of this cache in a cluster, or <code>null</code>
  +    * if running in local mode.
  +    * @return the local address of this cache in a cluster, or <code>null</code>
  +    * if running in local mode.
       */
      Address getLocalAddress();
   
      /**
  -    * @return a {@link List} of members in the cluster.  Null if running in local mode.
  +    * Returns a list of members in the cluster, or <code>null</code>
  +    * if running in local mode.
  +    * @return a {@link List} of members in the cluster, or <code>null</code>
  +    * if running in local mode.
       */
      List<Address> getMembers();
   
  @@ -261,6 +275,9 @@
      void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException;
   
      /**
  +    * Returns the version of the cache as a string.
  +    * 
  +    * @see Version#printVersion
       * @return the version string of the cache.
       */
      String getVersion();
  
  
  
  1.3       +9 -10     JBossCache/src/org/jboss/cache/CacheFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheFactory.java	18 Jan 2007 16:55:19 -0000	1.2
  +++ CacheFactory.java	19 Jan 2007 02:04:10 -0000	1.3
  @@ -10,8 +10,7 @@
   import org.jboss.cache.config.ConfigurationException;
   
   /**
  - * This factory constructs a cache from a given configuration set, and is also responsible for managing the lifecycle
  - * of the cache.
  + * This factory constructs a cache from a given or default configuration set.
    * <p/>
    * Typical usage would be:
    * <p/>
  @@ -19,15 +18,13 @@
    *   CacheFactory factory = DefaultCacheFactory.getInstance();
    *   Cache cache = factory.createCache("replSync-service.xml"); // expects this file to be in classpath
    * <p/>
  - *     ...
  - *     ...
  - * <p/>
  - *   factory.stopCache( cache );
  + *   cache.stop();
    * </pre>
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @see org.jboss.cache.Cache
    * @since 2.0.0
  + * @see DefaultCacheFactory
    */
   public interface CacheFactory
   {
  @@ -72,8 +69,9 @@
      /**
       * Creates a {@link Cache} instance based on a {@link org.jboss.cache.config.Configuration} passed in.
       * <p/>
  -    * Ensure that the Configuration you pass in is not used by another cache instance in the same JVM, as this may have untoward
  -    * consequences.  {@link org.jboss.cache.config.Configuration#clone()} is your friend.
  +    * Ensure that the Configuration you pass in is not used by another cache instance in the same JVM,
  +    * as it may be concurrently modified. Clone the configuration, if shared, using 
  +    * {@link org.jboss.cache.config.Configuration#clone()}.
       *
       * @param configuration the {@link Configuration} object that is passed in to setCache the {@link Cache}.
       * @return a running {@link Cache} instance
  @@ -85,8 +83,9 @@
      /**
       * Creates {@link Cache} instance, and optionally starts it, based on a {@link org.jboss.cache.config.Configuration} passed in.
       * <p/>
  -    * Ensure that the Configuration you pass in is not used by another cache instance in the same JVM, as this may have untoward
  -    * consequences.  {@link org.jboss.cache.config.Configuration#clone()} is your friend.
  +    * Ensure that the Configuration you pass in is not used by another cache instance in the same JVM,
  +    * as it may be concurrently modified. Clone the configuration, if shared, using 
  +    * {@link org.jboss.cache.config.Configuration#clone()}.
       *
       * @param configuration the {@link Configuration} object that is passed in to setCache the {@link Cache}.
       * @param start         if true, the cache is started before returning.
  
  
  
  1.7       +6 -2      JBossCache/src/org/jboss/cache/CacheListener.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheListener.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheListener.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- CacheListener.java	3 Jan 2007 17:50:31 -0000	1.6
  +++ CacheListener.java	19 Jan 2007 02:04:10 -0000	1.7
  @@ -15,11 +15,15 @@
    * <p/>
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
  - * @see Cache
  + * @see Cache#addCacheListener(CacheListener) to register a listener
    * @since 2.0.0
    */
   public interface CacheListener
   {
  +   
  +   /**
  +    * Different cache modification types.
  +    */
      public enum ModificationType
      {
         PUT_DATA, REMOVE_DATA, PUT_MAP
  
  
  
  1.2       +5 -1      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.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- DefaultCacheFactory.java	11 Jan 2007 13:49:07 -0000	1.1
  +++ DefaultCacheFactory.java	19 Jan 2007 02:04:10 -0000	1.2
  @@ -13,7 +13,8 @@
   import org.jboss.cache.factories.XmlConfigurationParser;
   
   /**
  - * Default implementation of the Cache Factory that contains only convenient static methods
  + * Default (singleton) implementation of the Cache Factory interface.
  + * Use {@link #getInstance()} to obtain an instance.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  @@ -30,6 +31,9 @@
         // protected constructor to prevent instantiation
      }
   
  +   /**
  +    * Returns a single instance of this class.
  +    */
      public static CacheFactory getInstance()
      {
         if (singleton == null)
  
  
  
  1.2       +2 -2      JBossCache/src/org/jboss/cache/DummyTransactionManagerLookup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DummyTransactionManagerLookup.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/DummyTransactionManagerLookup.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- DummyTransactionManagerLookup.java	31 Mar 2005 10:14:59 -0000	1.1
  +++ DummyTransactionManagerLookup.java	19 Jan 2007 02:04:10 -0000	1.2
  @@ -6,10 +6,10 @@
   
   
   /**
  - * Returns an instance of DummyTransactionManager, used by standalone cache.
  + * Returns an instance of {@link DummyTransactionManager}.
    *
    * @author Bela Ban Sept 5 2003
  - * @version $Id: DummyTransactionManagerLookup.java,v 1.1 2005/03/31 10:14:59 belaban Exp $
  + * @version $Id: DummyTransactionManagerLookup.java,v 1.2 2007/01/19 02:04:10 genman Exp $
    */
   public class DummyTransactionManagerLookup implements TransactionManagerLookup {
   
  
  
  
  1.47      +50 -6     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.46
  retrieving revision 1.47
  diff -u -b -r1.46 -r1.47
  --- Fqn.java	1 Jan 2007 22:12:19 -0000	1.46
  +++ Fqn.java	19 Jan 2007 02:04:10 -0000	1.47
  @@ -24,8 +24,26 @@
   import java.util.StringTokenizer;
   
   /**
  - * Fully qualified name.  A list of relatives names, which can be any Object,
  - * from root to a given node.  This class is immutable.
  + * A fully-qualified name (FQN) is a list of names
  + * (typically Strings but can be any Object),
  + * which specify a particular {@link Node} or sometimes a {@link Region} 
  + * in a {@link Cache}.
  + * This name can be relative from the root node, or relative to
  + * any node in the cache.
  + * <p/>
  + * For instance, using this class to fetch a particular node might look like
  + * this.  (Here data on "Joe" is kept under the "Smith" surname Node, under
  + * the "people" tree.) 
  + * <pre>
  + * Fqn abc = Fqn.fromString("/people/Smith/Joe/");
  + * Node joesmith = Cache.getRoot().getChild(abc);
  + * </pre>
  + * Alternatively, the same Fqn could be constructed using an array:
  + * <pre>
  + * Fqn abc = new Fqn(new String[] { "people", "Smith", "Joe" });
  + * </pre>
  + * This is a bit more efficient to construct. 
  + * 
    * <p/>
    * Note that<br>
    * <p/>
  @@ -39,9 +57,10 @@
    * <p/>
    * The latter will result in 3 Fqns, called "a", "b" and "c", where "c" is a child of "b", "b" is a child of "a", and "a" hangs off Fqn.ROOT.
    * <p/>
  - * Another way to look at it is that the "/" separarator is only parsed when it form sa  part of a String passed in to Fqn.fromString() and not otherwise.
  + * 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.46 $
  + * @version $Revision: 1.47 $
    */
   public class Fqn implements Cloneable, Externalizable, Comparable<Fqn>
   {
  @@ -371,7 +390,6 @@
   
      public void writeExternal(ObjectOutput out) throws IOException
      {
  -
         if (REL_123_COMPATIBLE)
         {
            out.writeObject(elements);
  @@ -408,7 +426,15 @@
   
   
      /**
  -    * Returns true if this fqn is child of parentFqn
  +    * Returns true if this fqn is child of parentFqn.
  +    * Example usage:
  +    <pre>
  +    Fqn f1 = Fqn.fromString("/a/b");
  +    Fqn f2 = Fqn.fromString("/a/b/c");
  +    // f1.isChildOf(f2) == true
  +    // f1.isChildOf(f1) == false
  +    // f2.isChildOf(f1) == false
  +    </pre>
       *
       * @param parentFqn
       * @return true if the target is a child of parentFqn
  @@ -422,6 +448,14 @@
   
      /**
       * Returns true if this fqn is equals or the child of parentFqn.
  +    * Example usage:
  +    <pre>
  +    Fqn f1 = Fqn.fromString("/a/b");
  +    Fqn f2 = Fqn.fromString("/a/b/c");
  +    // f1.isChildOrEquals(f2) == true
  +    // f1.isChildOrEquals(f1) == true
  +    // f2.isChildOrEquals(f1) == false
  +    </pre>
       */
      public boolean isChildOrEquals(Fqn parentFqn)
      {
  @@ -456,6 +490,16 @@
   
      /**
       * Returns the parent of this FQN.
  +    * The parent of the root node is {@link #ROOT}.
  +    * Examples:
  +    <pre>
  +    Fqn f1 = Fqn.fromString("/a");
  +    Fqn f2 = Fqn.fromString("/a/b");
  +    // f1.equals( f2.getParent() ) == true
  +    // f1.getParent().getParent().equals(Fqn.ROOT) == true
  +    // Fqn.ROOT.equals( Fqn.ROOT.getParent() ) == true
  +    </pre>
  +    * 
       */
      public Fqn getParent()
      {
  
  
  
  1.5       +15 -3     JBossCache/src/org/jboss/cache/GenericTransactionManagerLookup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: GenericTransactionManagerLookup.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/GenericTransactionManagerLookup.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- GenericTransactionManagerLookup.java	8 Jul 2005 11:09:20 -0000	1.4
  +++ GenericTransactionManagerLookup.java	19 Jan 2007 02:04:10 -0000	1.5
  @@ -10,10 +10,22 @@
   import java.lang.reflect.Method;
   
   /**
  - * A generic class that chooses the best-fit TransactionManager. Tries a number of well-known appservers
  + * A transaction manager lookup class that attempts to locate a TransactionManager.
  + * A variety of different classes and JNDI locations are tried, for servers
  + * such as:
  + * <ul>
  + * <li> JBoss
  + * <li> JRun4
  + * <li> Resin
  + * <li> Orion
  + * <li> JOnAS
  + * <li> BEA Weblogic
  + * <li> Websphere 4.0, 5.0, 5.1, 6.0
  + * </ul>
  + * If a transaction manager is not found, returns a {@link DummyTransactionManager}.
    *
    * @author Markus Plesser
  - * @version $Id: GenericTransactionManagerLookup.java,v 1.4 2005/07/08 11:09:20 bela Exp $
  + * @version $Id: GenericTransactionManagerLookup.java,v 1.5 2007/01/19 02:04:10 genman Exp $
    */
   public class GenericTransactionManagerLookup implements TransactionManagerLookup {
   
  @@ -47,7 +59,7 @@
      };
   
      /**
  -    * WebSphere 5.1 TransactionManagerFactory
  +    * WebSphere 5.1 and 6.0 TransactionManagerFactory
       */
      private static final String WS_FACTORY_CLASS_5_1="com.ibm.ws.Transaction.TransactionManagerFactory";
   
  
  
  
  1.2       +3 -2      JBossCache/src/org/jboss/cache/JBossTransactionManagerLookup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossTransactionManagerLookup.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/JBossTransactionManagerLookup.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- JBossTransactionManagerLookup.java	31 Mar 2005 10:15:00 -0000	1.1
  +++ JBossTransactionManagerLookup.java	19 Jan 2007 02:04:10 -0000	1.2
  @@ -4,10 +4,11 @@
   import javax.transaction.TransactionManager;
   
   /**
  - * Default implementation. Uses JNDI to lookup TransactionManager.
  + * Uses JNDI to look-up the
  + * {@link TransactionManager} instance from "java:/TransactionManager".
    *
    * @author Bela Ban, Aug 26 2003
  - * @version $Id: JBossTransactionManagerLookup.java,v 1.1 2005/03/31 10:15:00 belaban Exp $
  + * @version $Id: JBossTransactionManagerLookup.java,v 1.2 2007/01/19 02:04:10 genman Exp $
    */
   public class JBossTransactionManagerLookup implements TransactionManagerLookup {
   
  
  
  
  1.57      +63 -33    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.56
  retrieving revision 1.57
  diff -u -b -r1.56 -r1.57
  --- Node.java	10 Jan 2007 02:03:00 -0000	1.56
  +++ Node.java	19 Jan 2007 02:04:10 -0000	1.57
  @@ -10,10 +10,20 @@
   import java.util.Set;
   
   /**
  - * Along with {@link Cache}, this is a central construct in the cache structure of JBoss Cache.
  - * <p/>
  - * A Node represents a point in the cache.  A Node has references to it's children, parent
  - * (each Node has a single parent) and data contained within the Node (key value pairs).
  + * A Node is a {@link Fqn named} logical grouping of data in the JBoss {@link Cache}.
  + * A node should be used to contain data for a single data record, for example 
  + * information about a particular person or account.
  + * One purpose of grouping cache data into separate nodes is to minimize transaction
  + * locking interference,
  + * so for example, when multiple threads or possibly distributed caches are acccessing
  + * different accounts simultaneously. 
  + * Another is that when making changes to this Node, its data might be kept in a single 
  + * database row or file on disk.
  + * <p />
  + * A Node has references to its children, parent (each Node except the root has
  + * a single parent) and data contained within the Node (key-value pairs).  The
  + * data access methods are similar to the collections {@link Map} interface,
  + * but some are read-only or return copies of the underlying the data.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @see Cache
  @@ -22,31 +32,39 @@
   public interface Node
   {
      /**
  -    * @return the parent node.  If the current node is a root node, this call returns null.
  +    * Returns the parent node.
  +    * If this is the root node, this method returns <code>null</code>.
  +    * 
  +    * @return the parent node, or null if this is the root node  
       */
      Node getParent();
   
      /**
  +    * Returns an immutable set of children nodes.
       * @return an immutable {@link Set} of child nodes.  Empty {@link Set} if there aren't any children.
       */
      Set<Node> getChildren();
   
      /**
  +    * Returns an immutable set of children node names.
       * @return an immutable {@link Set} of child node names.  Empty {@link Set} if there aren't any children.
       */
      Set<Object> getChildrenNames();
   
      /**
  +    * Returns a map containing the data in this {@link Node}.
       * @return a {@link Map} containing the data in this {@link Node}.  If there is no data, an empty {@link Map} is returned.  The {@link Map} returned is always immutable.
       */
      Map<Object, Object> getData();
   
      /**
  +    * Returns a {@link Set} containing the data in this {@link Node}.
       * @return a {@link Set} containing the data in this {@link Node}.  If there is no data, an empty {@link Set} is returned.  The {@link Set} returned is always immutable.
       */
      Set<Object> getKeys();
   
      /**
  +    * Returns the {@link Fqn} which represents the location of this {@link Node} in the cache structure.  The {@link Fqn} returned is absolute.
       * @return The {@link Fqn} which represents the location of this {@link Node} in the cache structure.  The {@link Fqn} returned is absolute.
       */
      Fqn getFqn();
  @@ -95,70 +113,82 @@
      Node getChild(Object name);
   
      /**
  -    * Puts a key and a value into the current node's data map.
  -    * Overwrites if the key already exists.
  +    * Associates the specified value with the specified key for this node.
  +    * If this node previously contained a mapping for this key, the old value is replaced by the specified value.
       *
  -    * @param k
  -    * @param v
  +    * @param key   key with which the specified value is to be associated.
  +    * @param value value to be associated with the specified key.
       * @return Returns the old value contained under this key.  Null if key doesn't exist.
       */
  -   Object put(Object k, Object v);
  +   Object put(Object key, Object value);
   
      /**
  -    * Puts a key and a value into the current node's data map if nothing exists under the key.
  -    * Does nothing if the key already exists.
  +    * If the specified key is not already associated with a value, associate it with the given value.
       *
  -    * @param k
  -    * @param v
  +    * @param key   key with which the specified value is to be associated.
  +    * @param value value to be associated with the specified key.
       */
  -   void putIfAbsent(Object k, Object v);
  +   void putIfAbsent(Object key, Object value);
   
      /**
  -    * Puts an entire map of key-value pairs into the current node's data map.  If any data exists, existing
  -    * keys are overwritten with the keys in the new map.  Basically, does
  +    * Copies all of the mappings from the specified map to this node's map.
  +    * If any data exists, existing keys are overwritten with the keys in the new map.
  +    * The behavior is equivalent to:
       * <pre>
  -    *   data.addAll(m);
  +    * Node node;
  +    * for (Map.Entry me : map.entrySet())
  +    *   node.put(me.getKey(), me.getValue());
       * </pre>
  -    * Forms a union of the 2 data sets with the new data set taking precedence.
       *
  -    * @param m
  +    * @param map map to copy from
       */
  -   void put(Map<Object, Object> m);
  +   void put(Map<Object, Object> map);
   
      /**
  -    * Puts an entire map of key-value pairs into the current node's data map.  If any data exists, existing
  +    * Copies all of the mappings from the specified map to this node's map.
  +    * If any data exists, existing
       * keys are not overwritten with the keys in the new map.
       * <p/>
  -    * Forms a union of the 2 data sets with the old data set taking precedence.
  +    * The behavior is equivalent to:
  +    * <pre>
  +    * Node node;
  +    * for (Map.Entry me : map.entrySet())
  +    *   node.put(me.getKey(), me.getValue());
  +    * </pre>
       *
  -    * @param m
  +    * @param map map to copy from
       */
  -   void putIfAbsent(Map<Object, Object> m);
  +   void putIfAbsent(Map<Object, Object> map);
   
      /**
  -    * Gets data stored in the current node under key k
  +    * Returns the value to which this node maps the specified key.
  +    * Returns <code>null</code> if the node contains no mapping for this key. 
       *
       * @param k key of the data to return
  -    * @return arbitrary object stored under the key in this node, null if there is no data under the given key.
  +    * @return the value to which this node maps the specified key, or <code>null</code> if the map contains no mapping for this key
       */
      Object get(Object k);
   
      /**
  -    * Removes data stored under the given key.
  +    * Removes the mapping for this key from this node if it is present.
  +    * Returns the value to which the node previously associated the key,
  +    * or <code>null</code> if the node contained no mapping for this key
       *
  -    * @param k
  -    * @return Returns the old value contained under this key.  Null if key doesn't exist.
  +    * @param key key whose mapping is to be removed
  +    * @return previous value associated with specified key, or <code>null</code>
  +    * if there was no mapping for key
       */
  -   Object remove(Object k);
  +   Object remove(Object key);
   
      /**
  -    * Empties the data map.
  +    * Removes all mappings from the node's data map.
       */
      void clearData();
   
      /**
  +    * Returns true if the child node denoted by the relative {@link Fqn} passed in exists.
       * @param f {@link Fqn} relative to the current node of the child you are testing the existence of.
  -    * @return Returns true if the child node denoted by the {@link Fqn} passed in exists.
  +    * @return true if the child node denoted by the relative {@link Fqn} passed in exists.
       */
      boolean hasChild(Fqn f);
   }
  
  
  
  1.2       +1 -1      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.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- NodeFactory.java	11 Jan 2007 12:07:29 -0000	1.1
  +++ NodeFactory.java	19 Jan 2007 02:04:11 -0000	1.2
  @@ -13,7 +13,7 @@
   import java.util.Map;
   
   /**
  - * A factory that generates nodes.
  + * Generates new nodes based on the {@link CacheSPI} configuration.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  
  
  
  1.12      +52 -37    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.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- NodeSPI.java	10 Jan 2007 02:03:00 -0000	1.11
  +++ NodeSPI.java	19 Jan 2007 02:04:11 -0000	1.12
  @@ -26,7 +26,7 @@
    * <p/>
    * <ul>
    * <li>{@link Node#get(Object)} - Passes the call up the interceptor stack, applies all aspects including node locking, cache loading, passivation, etc etc.</li>
  - * <li>{@link NodeSPI#get(Object)} - directly works on the underlying data in the node.</li>
  + * <li>{@link NodeSPI#getDirect(Object)} - directly works on the underlying data in the node.</li>
    * </ul>
    * <p/>
    * The big difference with the direct access methods are that it is the onus of the caller to ensure proper locks are obtained
  @@ -45,7 +45,10 @@
    */
   public interface NodeSPI extends Node
   {
  +   
      /**
  +    * Returns true if the children of this node were loaded from a cache loader.
  +    * 
       * @return true if the children of this node were loaded from a cache loader.
       */
      boolean getChildrenLoaded();
  @@ -58,6 +61,8 @@
      void setChildrenLoaded(boolean loaded);
   
      /**
  +    * Returns true if the data was loaded from the cache loader.
  +    * 
       * @return true if the data was loaded from the cache loader.
       */
      public boolean getDataLoaded();
  @@ -105,6 +110,8 @@
      void setFqn(Fqn f);
   
      /**
  +    * Returns true if the instance has been deleted in the current transaction.
  +    * 
       * @return true if the instance has been deleted in the current transaction.
       */
      boolean isDeleted();
  @@ -124,6 +131,12 @@
       */
      void markAsDeleted(boolean marker, boolean recursive);
   
  +   /**
  +    * Adds or replaces a child by name.
  +    *  
  +    * @param nodeName child node name (not an FQN)
  +    * @param nodeToAdd child node
  +    */
      void addChild(Object nodeName, Node nodeToAdd);
   
      /**
  @@ -145,16 +158,18 @@
   
      // versioning
      /**
  -    * May throw UnsupportedOperationException if versioning is not used.  Otherwise, sets the data version of this node.
  +    * Sets the data version of this node if versioning is supported.
       *
  -    * @param version a {@link org.jboss.cache.optimistic.DataVersion} implementation.
  +    * @param version data version to apply
  +    * @throws UnsupportedOperationException if versioning is not supported  
       */
      void setVersion(DataVersion version);
   
      /**
  -    * May throw UnsupportedOperationException if versioning is not used.  Otherwise, retrieves the data version of the node.
  +    * Returns the data version of this node if versioning is supported.
       *
  -    * @return A data version
  +    * @return data version
  +    * @throws UnsupportedOperationException if versioning is not supported  
       */
      DataVersion getVersion();
   
  @@ -174,103 +189,102 @@
      Set<NodeSPI> getChildrenDirect();
   
      /**
  -    * Directly removes all children for this node.  The only direct method that does not have a non-direct counterpart.
  +    * Directly removes all children for this node.
  +    * The only direct method that does not have a non-direct counterpart.
       */
      void removeChildrenDirect();
   
  -
      /**
  -    * Retrieves children (directly), optionally including any marked as deleted.
  -    * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  +    * Retrieves children (directly), optionally including any marked as deleted nodes.
       * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
  -    * @param includeMarkedAsDeleted if true, even nodes marked as deleted will be returned.
  +    * @param includeMarkedAsDeleted if true, the returned set will include nodes marked as deleted
       * @return a set of nodes
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      Set<NodeSPI> getChildrenDirect(boolean includeMarkedAsDeleted);
   
      /**
  -    * Functionally the same as {@link #getChild(Object)} except that it operates directly on the node and bypasses the
  +    * Retrives a child directly by name.
  +    * Functionally the same as {@link #getChild(Object)} except that it bypasses the
       * interceptor chain.
       * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
       * @param childName
       * @return child node
       * @see #getChild(Object)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      NodeSPI getChildDirect(Object childName);
   
      /**
  -    * Functionally the same as {@link #addChild(Fqn)} except that it operates directly on the node and bypasses the
  +    * Adds a child directly to a Node.
  +    * Functionally the same as {@link #addChild(Fqn)} except that it bypasses the
       * interceptor chain.
       * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
       * @param childName
       * @return child node
       * @see #addChild(Fqn)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      NodeSPI addChildDirect(Fqn childName);
   
      /**
  -    * Functionally the same as {@link #getChild(Fqn)} except that it operates directly on the node and bypasses the
  +    * Retrives a child directly by fully qualified name.
  +    * Functionally the same as {@link #getChild(Fqn)} except that it bypasses the
       * interceptor chain.
       * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
       * @param childName
       * @return child node
       * @see #getChild(Fqn)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      NodeSPI getChildDirect(Fqn childName);
   
      /**
  -    * Functionally the same as {@link #removeChild(Fqn)} except that it operates directly on the node and bypasses the
  +    * Removes a child directly from a node.
  +    * Functionally the same as {@link #removeChild(Fqn)} except that it bypasses the
       * interceptor chain.
       * <p/>
       * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
       *
       * @param fqn of child.
       * @see #removeChild(Fqn)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      void removeChildDirect(Fqn fqn);
   
      /**
  -    * Functionally the same as {@link #removeChild(Object)} except that it operates directly on the node and bypasses the
  +    * Removes a child directly from a node.
  +    * Functionally the same as {@link #removeChild(Object)} except that bypasses the
       * interceptor chain.
       * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
       * @param childName of child.
       * @see #removeChild(Object)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      void removeChildDirect(Object childName);
   
   
      /**
  -    * Functionally the same as {@link #remove(Object)} except that it operates directly on the node and bypasses the
  +    * Removes a data key directly from a node.
  +    * Functionally the same as {@link #remove(Object)} except that it bypasses the
       * interceptor chain.
       * <p/>
  -    * The caller needs to ensure a proper lock has been obtained prior to calling this method, otherwise a
  -    * {@link org.jboss.cache.lock.LockingException} will be thrown.
  -    * <p/>
  +    * The caller needs to ensure a proper lock has been obtained prior to calling this method.
       *
       * @param key to remove
       * @return the old data contained under the key
       * @see #remove(Object)
  +    * @throws org.jboss.cache.lock.LockingException if locking was not obtained
       */
      Object removeDirect(Object key);
   
  @@ -380,7 +394,8 @@
      // ----------- these methods override their corresponding methods in Node, so that the return types are NodeSPI rather than Node.
   
      /**
  -    * Overrides {@link #getParent()} in {@link Node} so it returns a {@link NodeSPI} instead.  Otherwise identical.
  +    * Returns the parent node as a {@link NodeSPI}, instead
  +    * of {@link Node} from {@link Node#getParent()}, and is otherwise identical.
       *
       * @return parent node
       * @see Node#getParent()
  
  
  
  1.12      +72 -18    JBossCache/src/org/jboss/cache/Region.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Region.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Region.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- Region.java	4 Jan 2007 16:46:45 -0000	1.11
  +++ Region.java	19 Jan 2007 02:04:11 -0000	1.12
  @@ -13,74 +13,131 @@
   import org.jboss.cache.eviction.LRUPolicy;
   
   /**
  - * Represents a section of the cache, and characteristics such as class loading and activaton can be applied to regions.
  + * Defines characteristics such as class loading, replication, and eviction 
  + * of Nodes belonging to a region in a {@link Cache}.
  + * A region is described by an {@link #getFqn() FQN} relative to the root of the cache.
  + * All nodes and child nodes of this FQN belong to this region. 
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
   public interface Region extends Comparable<Region>
   {
  +   
  +   /**
  +    * Types of regions.
  +    */
      public enum Type
      {
         EVICTION, MARSHALLING, ANY
      }
   
      /**
  -    * Registers a specific {@link ClassLoader} (rather than the default) for a region, represented by a {@link Fqn}.
  +    * Registers a specific {@link ClassLoader} for this region,
  +    * overridding the default cache class loader. 
       *
  -    * @param classLoader
  +    * @param classLoader specific class loader
       */
      void registerContextClassLoader(ClassLoader classLoader);
   
      /**
  -    * Unregisters any specific {@link ClassLoader}s from a region.
  +    * Unregisters a registered {@link ClassLoader}s for this region.
       */
      void unregisterContextClassLoader();
   
      /**
  -    * Activates a region for replication (by default, the entire cache is activated)
  +    * Activates this region for replication.
  +    * By default, the entire cache is activated for replication at start-up.
       */
      void activate();
   
      /**
  -    * Deactivates a region from being replicated.
  +    * Deactivates this region from being replicated.
       */
      void deactivate();
   
      /**
  +    * Sets this region as active - this only marks a flag
  +    * and does not actually activates or
  +    * deactivates this region.  Use {@link #activate()}
  +    * and {@link #deactivate()} for the full process.
  +    *
  +    * @param b
  +    */
  +   void setActive(boolean b);
  +
  +   /**
  +    * Returns true if this region has been activated.
  +    * 
       * @return true if this region has been activated.
       */
      boolean isActive();
   
      /**
  -    * Looks up a {@link ClassLoader} for a given region.
  +    * Returns the configured {@link ClassLoader} for this region.
       *
       * @return a ClassLoader
       */
      ClassLoader getClassLoader();
   
      /**
  -    * Configures an eviction policy for the current region.
  +    * Configures an eviction policy for this region.
       *
  -    * @param evictionPolicyConfig
  +    * @param evictionPolicyConfig configuration to set
       */
      void setEvictionPolicy(EvictionPolicyConfig evictionPolicyConfig);
   
  +   /**
  +    * Returns an eviction policy configuration.
  +    *  
  +    * @return an eviction policy configuration
  +    */
      EvictionPolicyConfig getEvictionPolicyConfig();
   
  +   /**
  +    * Returns an eviction policy.
  +    *  
  +    * @return an eviction policy
  +    */
      EvictionPolicy getEvictionPolicy();
   
  +   /**
  +    * Returns an eviction region configuration for this region.
  +    * 
  +    * @return an eviction region configuration
  +    */
      EvictionRegionConfig getEvictionRegionConfig();
   
  +   /**
  +    * Clears the node event queue used for processing eviction.
  +    * 
  +    * @see #nodeEventQueueSize()
  +    */
      void resetEvictionQueues();
   
  +   /**
  +    * Returns the size of the node event queue.
  +    * 
  +    * @return number of events
  +    */
      int nodeEventQueueSize();
   
  +   /**
  +    * Returns the most recent node event added to the event queue by
  +    * {@link #putNodeEvent(EvictedEventNode)}.
  +    *  
  +    * @return the last evicted event node, or null if no more events exist
  +    */
      EvictedEventNode takeLastEventNode();
   
  +   /**
  +    * Adds an evicted node event to the internal queue.
  +    *  
  +    * @param event event to add
  +    */
      void putNodeEvent(EvictedEventNode event);
   
      /**
  -    * Add an event to the eviction queue marking a node as currently in use.
  +    * Marks a node as currently in use, by adding an event to the eviction queue.
       * If there is an {@link EvictionPolicy} associated with this region, and
       * it respects this event ({@link LRUPolicy} does), then the node will not
       * be evicted until {@link #unmarkNodeCurrentlyInUse(Fqn)} is invoked.
  @@ -95,20 +152,17 @@
      void markNodeCurrentlyInUse(Fqn fqn, long timeout);
   
      /**
  -    * Add an event to the eviction queue indicating that a node is no longer in use.
  +    * Adds an event to the eviction queue indicating that a node is no longer in use.
       *
       * @param fqn Fqn of the node.
       * @see #markNodeCurrentlyInUse(Fqn,long)
       */
      void unmarkNodeCurrentlyInUse(Fqn fqn);
   
  -   Fqn getFqn();
  -
      /**
  -    * Sets this region as active - this only marks a flag and does not activate the region.  Use {@link #activate()}
  -    * and {@link #deactivate()} for the full process.
  -    *
  -    * @param b
  +    * Returns the fully-qualified name of this region.
  +    * @return the FQN
       */
  -   void setActive(boolean b);
  +   Fqn getFqn();
  +
   }
  
  
  
  1.25      +62 -13    JBossCache/src/org/jboss/cache/RegionManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RegionManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionManager.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- RegionManager.java	17 Jan 2007 17:21:37 -0000	1.24
  +++ RegionManager.java	19 Jan 2007 02:04:11 -0000	1.25
  @@ -21,7 +21,7 @@
   import java.util.concurrent.ConcurrentHashMap;
   
   /**
  - * Encapsulates the concept of a {@link Region}, and manages instances of such regions.
  + * Manages multiple {@link Region}s for a Cache instance.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani</a>
    * @since 2.0.0
  @@ -33,7 +33,8 @@
       * eviction settings bound under this 'default' Fqn is appplied to {@link org.jboss.cache.Fqn#ROOT} internally so
       * any region that is not explicitly defined comes under the settings defined for this default.
       */
  -   public static final Fqn DEFAULT_REGION = Fqn.fromString("/_default_");
  +   public static final Fqn DEFAULT_REGION = new Fqn("_default_");
  +   
      /**
       * A registry of regions that have been defined.
       */
  @@ -47,32 +48,45 @@
   
      protected final Set activationChangeNodes = Collections.synchronizedSet(new HashSet());
   
  -
  +   /**
  +    * Constructs a new instance not attached to a cache.
  +    */
      public RegionManager()
      {
      }
   
  -   public boolean isUsingEvictions()
  +   /**
  +    * Constructs a new instance attached to a cache.
  +    */
  +   public RegionManager(CacheImpl cache)
      {
  -      return usingEvictions;
  +      this.cache = cache;
      }
   
  -   public RegionManager(CacheImpl cache)
  +   /**
  +    * Returns true if evictions are being processed.
  +    */
  +   public boolean isUsingEvictions()
      {
  -      this.cache = cache;
  +      return usingEvictions;
      }
   
  +   /**
  +    * Returns true if replication is by default inactive.
  +    */
      public boolean isDefaultInactive()
      {
         return defaultInactive;
      }
   
  +   /**
  +    * Sets if replication is by default inactive.
  +    */
      public void setDefaultInactive(boolean defaultInactive)
      {
         this.defaultInactive = defaultInactive;
      }
   
  -
      /**
       * Helper utility that checks for a classloader registered for the
       * given Fqn, and if found sets it as the TCCL. If the given Fqn is
  @@ -115,11 +129,17 @@
         setContextClassLoaderAsCurrent(Fqn.fromString(fqn));
      }
   
  +   /**
  +    * Returns a region by FQN, creating it optionally if absent.
  +    */
      public Region getRegion(Fqn fqn, boolean createIfAbsent)
      {
         return getRegion(fqn, Region.Type.ANY, createIfAbsent);
      }
   
  +   /**
  +    * Returns a region by FQN, with a type, creating it optionally if absent.
  +    */
      public Region getRegion(Fqn fqn, Region.Type type, boolean createIfAbsent)
      {
         Fqn fqnToUse = fqn;
  @@ -178,7 +198,7 @@
      }
   
      /**
  -    * Overloaded form of {@link #getRegion(Fqn,boolean)}
  +    * Returns a region using Fqn.fromString(fqn), calling {@link #getRegion(Fqn,boolean)}
       *
       * @param fqn
       * @param createIfAbsent
  @@ -189,6 +209,9 @@
         return getRegion(Fqn.fromString(fqn), createIfAbsent);
      }
   
  +   /**
  +    * Registers a classloader under an FQN.
  +    */
      public void registerClassLoader(Fqn fqn, ClassLoader cl)
      {
         Region existing = getRegion(fqn, false);
  @@ -222,12 +245,17 @@
         if (region != null) region.unregisterContextClassLoader();
      }
   
  -
  +   /**
  +    * Unregisters a classloader by FQN.
  +    */
      public void unregisterClassLoader(String fqn)
      {
         unregisterClassLoader(Fqn.fromString(fqn));
      }
   
  +   /**
  +    * Removes a region by FQN.
  +    */
      public void removeRegion(Fqn fqn)
      {
         Region r = regionsRegistry.remove(fqn);
  @@ -245,8 +273,8 @@
         return evictionTimerTask;
      }
   
  -
      /**
  +    * Removes a region by FQN.
       * Overloaded form of {@link #removeRegion(Fqn)}
       *
       * @param fqn
  @@ -617,7 +645,11 @@
         activate(Fqn.fromString(fqn));
      }
   
  -
  +   /**
  +    * Returns true if the region exists
  +    * @param fqn FQN of the region
  +    * @return true if the region exists
  +    */
      public boolean hasRegion(Fqn fqn)
      {
         return regionsRegistry.containsKey(fqn);
  @@ -723,6 +755,7 @@
      }
   
      /**
  +    * Returns an ordered list of all active regions which have defined eviction policies.
       * Note that the ordered list returned is sorted according to the natural order defined in the {@link Comparable} interface, which {@link org.jboss.cache.Region} extends.
       *
       * @return an ordered list of all active regions which have defined eviction policies.
  @@ -742,6 +775,7 @@
      }
   
      /**
  +    * Returns an ordered list of all regions.
       * Note that the ordered list returned is sorted according to the natural order defined in the {@link Comparable} interface, which {@link org.jboss.cache.Region} extends.
       *
       * @return an ordered list of all regions, regardless of whether they are active, have eviction policies defined or have class loaders set.
  @@ -755,11 +789,17 @@
         return regions;
      }
   
  +   /**
  +    * Sets if evictions are processed.
  +    */
      public void setUsingEvictions(boolean usingEvictions)
      {
         this.usingEvictions = usingEvictions;
      }
   
  +   /**
  +    * Sets the eviction configuration.
  +    */
      public void setEvictionConfig(EvictionConfig evictionConfig)
      {
         this.evictionConfig = evictionConfig;
  @@ -785,13 +825,16 @@
         }
      }
   
  +   /**
  +    * Starts the eviction processing thread.
  +    */
      public void startEvictionThread()
      {
         evictionTimerTask.init(evictionConfig.getWakeupIntervalSeconds(), cache.getNotifier());
      }
   
      /**
  -    * Debug Method
  +    * Returns a string containing debug information on every region.
       */
      public String dumpRegions()
      {
  @@ -804,11 +847,17 @@
         return sb.toString();
      }
   
  +   /**
  +    * Returns a string containing debug information on every region.
  +    */
      public String toString()
      {
         return "RegionManager " + dumpRegions();
      }
   
  +   /**
  +    * Returns the cache for this region.
  +    */
      public CacheImpl getCache()
      {
         return this.cache;
  
  
  
  1.3       +3 -4      JBossCache/src/org/jboss/cache/RegionNotEmptyException.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RegionNotEmptyException.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionNotEmptyException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- RegionNotEmptyException.java	30 Dec 2006 17:49:54 -0000	1.2
  +++ RegionNotEmptyException.java	19 Jan 2007 02:04:11 -0000	1.3
  @@ -10,13 +10,12 @@
   /**
    * Thrown when an attempt is made to
    * {@link CacheImpl#activateRegion(String) activate a subtree}
  - * roote in  Fqn that already has an existing node in the cache.
  + * root in Fqn that already has an existing node in the cache.
    *
    * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
    * @version $Revision$
  - * @see CacheImpl#activateRegion(String)
  - * @see CacheImpl#exists(Fqn)
  - * @see CacheImpl#exists(String)
  + * @see Cache#exists(Fqn)
  + * @see Cache#exists(String)
    */
   public class RegionNotEmptyException extends CacheException
   {
  
  
  
  1.20      +5 -5      JBossCache/src/org/jboss/cache/TransactionEntry.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TransactionEntry.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TransactionEntry.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- TransactionEntry.java	3 Jan 2007 15:33:09 -0000	1.19
  +++ TransactionEntry.java	19 Jan 2007 02:04:11 -0000	1.20
  @@ -24,12 +24,12 @@
   import java.util.ListIterator;
   
   /**
  - * This is the value (key being the {@link GlobalTransaction}) in the transaction table
  - * of CacheImpl.
  - * <br>A TransactionEntry maintains
  + * Information associated with a {@link GlobalTransaction} about the transaction state.
  + * <p/>
  + * A TransactionEntry maintains:
    * <ul>
    * <li>Handle to local Transactions: there can be more than 1 local TX associated with a GlobalTransaction
  - * <li>List of modifications (Modification)
  + * <li>List of modifications ({@link Modification})
    * <li>List of nodes that were created as part of lock acquisition. These nodes can be
    * safely deleted when a transaction is rolled back
    * <li>List of locks ({@link IdentityLock}) that have been acquired by
  @@ -37,7 +37,7 @@
    * </ul>
    *
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> Apr 14, 2003
  - * @version $Revision: 1.19 $
  + * @version $Revision: 1.20 $
    */
   public class TransactionEntry
   {
  
  
  
  1.4       +6 -2      JBossCache/src/org/jboss/cache/TransactionManagerLookup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TransactionManagerLookup.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TransactionManagerLookup.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- TransactionManagerLookup.java	30 Dec 2006 17:49:54 -0000	1.3
  +++ TransactionManagerLookup.java	19 Jan 2007 02:04:11 -0000	1.4
  @@ -2,11 +2,15 @@
   
   import javax.transaction.TransactionManager;
   
  +import org.jboss.cache.config.Configuration;
  +
   /**
  - * Factory interface, allows CacheImpl to use different transactional systems.
  + * Factory interface, allows {@link Cache} to use different transactional systems.
  + * Names of implementors of this class can be configured using
  + * {@link Configuration#setTransactionManagerLookupClass}.
    *
    * @author Bela Ban, Aug 26 2003
  - * @version $Id: TransactionManagerLookup.java,v 1.3 2006/12/30 17:49:54 msurtani Exp $
  + * @version $Id: TransactionManagerLookup.java,v 1.4 2007/01/19 02:04:11 genman Exp $
    */
   public interface TransactionManagerLookup
   {
  
  
  
  1.12      +3 -4      JBossCache/src/org/jboss/cache/TransactionTable.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TransactionTable.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TransactionTable.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- TransactionTable.java	8 Dec 2006 18:49:17 -0000	1.11
  +++ TransactionTable.java	19 Jan 2007 02:04:11 -0000	1.12
  @@ -19,12 +19,11 @@
   import java.util.concurrent.ConcurrentHashMap;
   
   /**
  - * Maintains the mapping between local (Transaction) and global transactions
  - * (GlobalTransaction). Also keys modifications and undo-operations) under a
  - * given TX.
  + * Maintains the mapping between a local {@link Transaction} and a {@link GlobalTransaction}.
  + * Also stores {@link TransactionEntry} instances under a given transaction.
    *
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> Apr 14, 2003
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class TransactionTable {
   
  
  
  
  1.23      +2 -2      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.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- TreeCacheView.java	11 Jan 2007 13:49:07 -0000	1.22
  +++ TreeCacheView.java	19 Jan 2007 02:04:11 -0000	1.23
  @@ -53,8 +53,8 @@
    * The view itself caches only the nodes, but doesn't cache any of the data (HashMap) associated with it. When
    * data needs to be displayed, the underlying cache will be accessed directly.
    *
  - * @version $Revision: 1.22 $
  - * @author<a href="mailto:bela at jboss.org">Bela Ban</a> March 27 2003
  + * @version $Revision: 1.23 $
  + * @author Bela Ban
    */
   public class TreeCacheView implements TreeCacheViewMBean
   {
  
  
  
  1.28      +6 -3      JBossCache/src/org/jboss/cache/Version.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Version.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Version.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -b -r1.27 -r1.28
  --- Version.java	10 Jan 2007 14:08:14 -0000	1.27
  +++ Version.java	19 Jan 2007 02:04:11 -0000	1.28
  @@ -3,17 +3,17 @@
   import java.util.StringTokenizer;
   
   /**
  - * Contains version information about this release of CacheImpl.
  + * Contains version information about this release of JBoss Cache.
    *
    * @author Bela Ban
  - * @version $Id: Version.java,v 1.27 2007/01/10 14:08:14 msurtani Exp $
  + * @version $Id: Version.java,v 1.28 2007/01/19 02:04:11 genman Exp $
    */
   public class Version
   {
      public static final String version = "2.0.0.BETA1";
      public static final String codename = "Habanero";
      public static byte[] version_id = {'0', '2', '0', '0', 'b'};
  -   public static final String cvs = "$Id: Version.java,v 1.27 2007/01/10 14:08:14 msurtani Exp $";
  +   public static final String cvs = "$Id: Version.java,v 1.28 2007/01/19 02:04:11 genman Exp $";
   
      private static final int MAJOR_SHIFT = 11;
      private static final int MINOR_SHIFT = 6;
  @@ -157,6 +157,9 @@
         return (version > 1241 && version <= SHORT_1_2_3);
      }
   
  +   /**
  +    * Retroweaver version info.
  +    */
      public static class Retro
      {
         public static void main(String[] args)
  
  
  
  1.9       +4 -1      JBossCache/src/org/jboss/cache/VersionedNode.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: VersionedNode.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/VersionedNode.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- VersionedNode.java	17 Jan 2007 16:24:07 -0000	1.8
  +++ VersionedNode.java	19 Jan 2007 02:04:11 -0000	1.9
  @@ -12,7 +12,7 @@
   import java.util.Map;
   
   /**
  - * VersionedNode contains a data version.
  + * VersionedNode extends the unversioned node by adding a data version.
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
  @@ -39,6 +39,7 @@
       *
       * @return the version
       */
  +   @Override
      public DataVersion getVersion()
      {
         return version;
  @@ -47,6 +48,7 @@
      /**
       * Returns the parent.
       */
  +   @Override
      public NodeSPI getParent()
      {
         return parent;
  @@ -57,6 +59,7 @@
       *
       * @param version
       */
  +   @Override
      public void setVersion(DataVersion version)
      {
         this.version = version;
  
  
  



More information about the jboss-cvs-commits mailing list