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

Manik Surtani manik at jboss.org
Mon Apr 23 11:56:30 EDT 2007


  User: msurtani
  Date: 07/04/23 11:56:30

  Modified:    src/org/jboss/cache   Region.java RegionManager.java
  Log:
  Better comments and javadocs in Region and RegionManager, plus enabled tests in test class
  
  Revision  Changes    Path
  1.15      +9 -0      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.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- Region.java	30 Mar 2007 14:22:27 -0000	1.14
  +++ Region.java	23 Apr 2007 15:56:30 -0000	1.15
  @@ -16,6 +16,15 @@
    * Defines characteristics such as class loading and eviction of {@link org.jboss.cache.Node}s 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.
  + * <p/>
  + * If a region is to be recognised as an eviction region (region of type {@link Type#EVICTION} then
  + * it <b>must</b> have an {@link org.jboss.cache.eviction.EvictionPolicyConfig} set using {@link #setEvictionPolicy(org.jboss.cache.eviction.EvictionPolicyConfig)}.
  + * <p/>
  + * Similarly, to be recognised as a marshalling region (region of type {@link Type#MARSHALLING} then it <b>must</b> have a
  + * {@link ClassLoader} registered using {@link #registerContextClassLoader(ClassLoader)}.
  + * <p/>
  + * Note that a single region can be both an eviction and marshalling region at the same time.
  + * <p/>
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @see org.jboss.cache.RegionManager
  
  
  
  1.35      +10 -0     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.34
  retrieving revision 1.35
  diff -u -b -r1.34 -r1.35
  --- RegionManager.java	30 Mar 2007 14:22:27 -0000	1.34
  +++ RegionManager.java	23 Apr 2007 15:56:30 -0000	1.35
  @@ -143,6 +143,9 @@
         if (regionsRegistry.containsKey(fqnToUse))
         {
            Region r = regionsRegistry.get(fqnToUse);
  +
  +         // this is a very poor way of telling whether a region is a marshalling one or an eviction one.  :-(
  +         // mandates that class loaders be registered for marshalling regions.
            if (type == Region.Type.ANY
                    || (type == Region.Type.MARSHALLING && r.getClassLoader() != null)
                    || (type == Region.Type.EVICTION && r.getEvictionPolicyConfig() != null))
  @@ -156,6 +159,11 @@
         {
            Region r = new RegionImpl(fqnToUse, this);
            regionsRegistry.put(fqnToUse, r);
  +         if (type == Region.Type.MARSHALLING)
  +         {
  +            // insert current class loader into region so at least it is recognised as a marshalling region
  +            r.registerContextClassLoader(getClass().getClassLoader());
  +         }
            return r;
         }
         else
  @@ -179,6 +187,8 @@
            {
               Region r = regionsRegistry.get(nextFqn);
   
  +            // this is a very poor way of telling whether a region is a marshalling one or an eviction one.  :-(
  +            // mandates that class loaders be registered for marshalling regions.
               if (type == Region.Type.ANY
                       || (type == Region.Type.MARSHALLING && r.getClassLoader() != null)
                       || (type == Region.Type.EVICTION && r.getEvictionPolicyConfig() != null))
  
  
  



More information about the jboss-cvs-commits mailing list