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

Brian Stansberry brian.stansberry at jboss.com
Wed Oct 25 00:52:51 EDT 2006


  User: bstansberry
  Date: 06/10/25 00:52:51

  Modified:    src/org/jboss/cache/aop  PojoCache.java
  Log:
  Handle parsing of config XML in XmlConfigurationParser 
  Use the proper config format
  
  Revision  Changes    Path
  1.31      +17 -4     JBossCache/src/org/jboss/cache/aop/PojoCache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PojoCache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/PojoCache.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -b -r1.30 -r1.31
  --- PojoCache.java	12 Oct 2006 23:03:59 -0000	1.30
  +++ PojoCache.java	25 Oct 2006 04:52:51 -0000	1.31
  @@ -15,10 +15,12 @@
   import org.jboss.cache.TreeCache;
   import org.jboss.cache.aop.eviction.AopEvictionPolicy;
   import org.jboss.cache.aop.statetransfer.PojoStateTransferManager;
  +import org.jboss.cache.config.EvictionConfig;
   import org.jboss.cache.lock.UpgradeException;
   import org.jboss.cache.marshall.ObjectSerializationFactory;
   import org.jboss.cache.marshall.RegionNameConflictException;
   import org.jboss.cache.transaction.BatchModeTransactionManager;
  +import org.jboss.cache.util.Util;
   import org.jboss.cache.xml.XmlHelper;
   import org.jgroups.JChannel;
   import org.w3c.dom.Element;
  @@ -120,17 +122,28 @@
       */
      public void setEvictionPolicyClass(String eviction_policy_class)
      {
  -      getConfiguration().setEvictionPolicyClass(eviction_policy_class);
  +      // FIXME (BES Oct-24-2006) I can't see where this method is ever invoked.
  +      // We need to check if something fell through the cracks when we refactored
  +      // out the Configuration object
  +      
  +      EvictionConfig ec = getConfiguration().getEvictionConfig();
  +      if (ec == null)
  +         return;
  +      
  +      ec.setDefaultEvictionPolicyClass(eviction_policy_class);
         if (eviction_policy_class == null || eviction_policy_class.length() == 0)
            return;
   
         try
         {
  -         Object obj = loadClass(eviction_policy_class).newInstance();
  +         Object obj = Util.loadClass(eviction_policy_class).newInstance();
            if (!(obj instanceof AopEvictionPolicy))
               throw new RuntimeException("PojoCache.setEvictionPolicyClass(). Eviction policy provider:" +
                       eviction_policy_class + " is not an instance of AopEvictionPolicy.");
  -         getConfiguration().setEvictionPolicyClass(eviction_policy_class);
  +         ec.setDefaultEvictionPolicyClass(eviction_policy_class);
  +         
  +         // FIXME shouldn't we loop through the regions as well, as they can
  +         // also have individual policies?
         }
         catch (RuntimeException ex)
         {
  
  
  



More information about the jboss-cvs-commits mailing list