[jboss-dev-forums] [Design of JBossCache] - Re: Region management issues

bstansberry@jboss.com do-not-reply at jboss.com
Thu Jul 26 12:17:58 EDT 2007


Agreed that this is hacky, but either option is an implementation detail that can be changed. The hack should be simple and allows us to avoid adding a behavior change vs 1.x in 2.0.  We can then look at non-hacky approaches at greater leisure.  If we don't restore the 1.x behavior in 2.0, we really shouldn't restore it at all.

Here's the hack impl.  I haven't tried this; only quality guarantee I can give is that Eclipse doesn't give me any compile error warnings:


  | Index: RegionManager.java
  | ===================================================================
  | RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RegionManager.java,v
  | retrieving revision 1.38
  | diff -u -r1.38 RegionManager.java
  | --- RegionManager.java	28 Jun 2007 16:53:35 -0000	1.38
  | +++ RegionManager.java	26 Jul 2007 16:08:42 -0000
  | @@ -139,6 +139,8 @@
  |     {
  |        Fqn fqnToUse = fqn;
  |        if (DEFAULT_REGION.equals(fqnToUse)) fqnToUse = Fqn.ROOT;
  | +      
  | +      Region firstFound = null;
  |        // first see if a region for this specific Fqn exists
  |        if (regionsRegistry.containsKey(fqnToUse))
  |        {
  | @@ -152,6 +154,12 @@
  |           {
  |              return r;
  |           }
  | +         
  | +         if (type == Region.Type.MARSHALLING)
  | +         {
  | +            firstFound = r;
  | +         }
  | +            
  |        }
  |  
  |        // if not, attempt to create one ...
  | @@ -195,11 +203,16 @@
  |              {
  |                 nextBestThing = r;
  |              }
  | +            
  | +            if (type == Region.Type.MARSHALLING && firstFound == null)
  | +            {
  | +               firstFound = r;
  | +            }
  |           }
  |           if (nextFqn.isRoot()) break;
  |        }
  |  
  | -      return nextBestThing;
  | +      return (nextBestThing == null ? firstFound : nextBestThing);
  |     }
  |  
  |     /**

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4067901#4067901

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4067901



More information about the jboss-dev-forums mailing list