[jboss-cvs] JBossAS SVN: r63404 - in trunk/tomcat/src: resources and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 7 17:32:31 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-06-07 17:32:31 -0400 (Thu, 07 Jun 2007)
New Revision: 63404

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/CacheListener.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java
   trunk/tomcat/src/resources/jboss-web-cluster-beans.xml
Log:
[JBAS-4476] Switch to JBC 2.0.0.CR2

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/CacheListener.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/CacheListener.java	2007-06-07 21:31:57 UTC (rev 63403)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/CacheListener.java	2007-06-07 21:32:31 UTC (rev 63404)
@@ -200,7 +200,7 @@
    }
    
    @Override
-   public void nodeActivated(Fqn fqn, boolean pre)
+   public void nodeActivated(Fqn fqn, boolean pre, Map<Object, Object> data)
    {
       // we don't need to handle node activation notification since the 
       // session manager will notify any servlet API listeners upon 
@@ -209,7 +209,7 @@
    
    // FIXME why would there be a notification of passivation on another node?
    @Override
-   public void nodePassivated(Fqn fqn, boolean pre)
+   public void nodePassivated(Fqn fqn, boolean pre, Map<Object, Object> data)
    {
       if (!pre || SessionReplicationContext.isLocallyActive())
          return;

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java	2007-06-07 21:31:57 UTC (rev 63403)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java	2007-06-07 21:32:31 UTC (rev 63404)
@@ -773,23 +773,13 @@
          else
          {
             // See if there is an XML descriptor file to configure the cache
-            InputStream configIS = getCacheConfigStream();
+            File configFile = getCacheConfigFile();
             
-            Configuration config = null;
-            
-            if (configIS != null)
+            if (configFile != null)
             {
-               XmlConfigurationParser parser = new XmlConfigurationParser();
-               config = parser.parseStream(configIS);
-               try 
-               {
-                  configIS.close();
-               }
-               catch (IOException io)
-               {
-                  // ignore
-               }
-               
+               pojoCache = new PojoCacheJmxWrapper(PojoCacheFactory.createCache(configFile.getAbsolutePath(), false));
+               Configuration config = pojoCache.getConfiguration();
+                              
                if (clusterName != null)
                {
                   // Override the XML config with the name provided in
@@ -803,7 +793,7 @@
                // User did not try to configure the cache.
                // Configure it using defaults.  Only exception
                // is the clusterName, which user can specify in server.xml.
-               config = new Configuration();
+               Configuration config = new Configuration();
                String channelName = (clusterName == null) ? DEFAULT_CLUSTER_NAME
                                                           : clusterName;
                config.setClusterName(channelName);
@@ -811,9 +801,9 @@
                config.setCacheMode(DEFAULT_CACHE_MODE);
                config.setLockAcquisitionTimeout(DEFAULT_LOCK_TIMEOUT);
                config.setTransactionManagerLookupClass(DEFAULT_TM_LOOKUP);
+               
+               pojoCache = new PojoCacheJmxWrapper(PojoCacheFactory.createCache(config, false));
             }
-
-            pojoCache = new PojoCacheJmxWrapper(PojoCacheFactory.createCache(config, false));
             
             pojoCacheLocal = true;
          }
@@ -823,7 +813,7 @@
    
    
 
-   private InputStream getCacheConfigStream() throws FileNotFoundException
+   private File getCacheConfigFile() throws FileNotFoundException
    {
       boolean useDefault = (this.cacheConfigPath == null);
       String path = (useDefault) ? DEFAULT_CACHE_CONFIG_PATH : cacheConfigPath;
@@ -835,27 +825,18 @@
          file = new File(System.getProperty("catalina.base"), path);
       }
       
-      try
+      if (file.exists())
       {
-         return new FileInputStream(file);
+         return file;
       }
-      catch (FileNotFoundException fnf)
+      else
       {
-         if (useDefault)
-         {
-            // Not a problem, just means user did not try to
-            // configure the cache.  Return null and let the cache
-            // be configured from defaults.
-            return null;
-         }
-         else
-         {
-            // User provided config was invalid; throw the exception
-            log.error("No tree cache config file found at " + 
-                      file.getAbsolutePath());
-            throw fnf;
-         }
-      }      
+         // User provided config was invalid; throw the exception
+         String msg = "No tree cache config file found at " + 
+                        file.getAbsolutePath();
+         log.error(msg);
+         throw new IllegalStateException(msg);
+      }    
    }
 
    /**

Modified: trunk/tomcat/src/resources/jboss-web-cluster-beans.xml
===================================================================
--- trunk/tomcat/src/resources/jboss-web-cluster-beans.xml	2007-06-07 21:31:57 UTC (rev 63403)
+++ trunk/tomcat/src/resources/jboss-web-cluster-beans.xml	2007-06-07 21:32:31 UTC (rev 63404)
@@ -11,7 +11,7 @@
             <property name="transactionManager">
             	<bean name="TomcatClusteringBatchManager" class="org.jboss.cache.transaction.BatchModeTransactionManager"/>
             </property>
-            <property name="muxChannelFactory"><inject bean="jgroups.mux:name=Multiplexer"/></property>
+            <property name="muxChannelFactory"><inject bean="JChannelFactory"/></property>
          </bean>
       </property>
       
@@ -61,7 +61,7 @@
                 	<list>
                 		<bean name="TomcatClusteringFileCacheLoader" class="org.jboss.cache.loader.FileCacheLoaderConfig">
                 			<property name="location">${jboss.server.data.dir}${/}tomcat-cluster</property>
-                    		<property name="async">true</property>
+                    		<property name="async">false</property>
                     		<property name="fetchPersistentState">true</property>
                     		<property name="ignoreModifications">false</property>
                 		</bean>




More information about the jboss-cvs-commits mailing list