[jboss-cvs] JBossAS SVN: r75641 - in projects/metadata/trunk/src: main/resources/dtd and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 10 17:54:47 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-07-10 17:54:47 -0400 (Thu, 10 Jul 2008)
New Revision: 75641

Modified:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/ReplicationConfig.java
   projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd
   projects/metadata/trunk/src/test/java/org/jboss/test/metadata/web/JBossWeb50UnitTestCase.java
   projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/web/JBossWeb50_testClustering.xml
Log:
[JBMETA-73] Add max-unreplicated-interval to jboss-web.xml replication-config

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/ReplicationConfig.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/ReplicationConfig.java	2008-07-10 21:41:35 UTC (rev 75640)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/ReplicationConfig.java	2008-07-10 21:54:47 UTC (rev 75641)
@@ -37,6 +37,7 @@
    protected Boolean fieldBatchMode;
    protected String cacheName;
    protected Boolean useJK;
+   protected Integer maxUnreplicatedInterval;
    protected SnapshotMode snapshotMode;
    protected Integer snapshotInterval;
    
@@ -110,6 +111,16 @@
       this.useJK = useJK;
    }
 
+   public Integer getMaxUnreplicatedInterval()
+   {
+      return maxUnreplicatedInterval;
+   }
+
+   public void setMaxUnreplicatedInterval(Integer maxUnreplicatedInterval)
+   {
+      this.maxUnreplicatedInterval = maxUnreplicatedInterval;
+   }
+
    public String toString()
    {
       StringBuffer sb = new StringBuffer(100);
@@ -118,6 +129,7 @@
         .append(";trigger=").append(trigger)
         .append(";fieldBatchMode=").append(fieldBatchMode)
         .append(";useJK=").append(useJK)
+        .append(";maxUnreplicatedInterval=").append(maxUnreplicatedInterval)
         .append(";snapshotMode=").append(snapshotMode)
         .append(";snapshotInterval=").append(snapshotInterval);
       return sb.toString();

Modified: projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd
===================================================================
--- projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd	2008-07-10 21:41:35 UTC (rev 75640)
+++ projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd	2008-07-10 21:54:47 UTC (rev 75641)
@@ -347,7 +347,7 @@
 <!--
    HTTP Session clustering configuration (optional tags)
 -->
-<!ELEMENT replication-config (cache-name?, replication-trigger?, replication-granularity, replication-field-batch-mode?, use-jk?, snapshot-mode?, snapshot-interval?)>
+<!ELEMENT replication-config (cache-name?, replication-trigger?, replication-granularity, replication-field-batch-mode?, use-jk?, max-unreplicated-interval?, snapshot-mode?, snapshot-interval?)>
 
 <!--
    Clustering only: Name of the JBoss Cache or PojoCache configuration that 
@@ -465,6 +465,33 @@
 <!ELEMENT use-jk (#PCDATA)>
 
 <!--
+   Clustering only: Determines the maximum interval between requests, in 
+   seconds, after which a request will trigger replication of the session's 
+   timestamp and other metadata regardless of whether the request has otherwise 
+   made the session dirty.  Such replication ensures that other nodes in the 
+   cluster are aware of the most recent value for the session's timestamp 
+   and won't incorrectly expire an unreplicated session upon failover. It also
+   results in correct values for HttpSession.getLastAccessedTime() calls 
+   following failover.
+
+   The cost of this metadata replication depends on the configured
+   replication-granularity. With <code>SESSION</code>, the session's 
+   attribute map is replicated along with the metadata, so it can be fairly 
+   costly.  With other granularities, the metadata object is replicated 
+   separately from the attributes and only contains a String, and a few longs, 
+   ints and booleans.
+   
+   A value of 0 means the metadata will be replicated whenever the session is
+   accessed.  A value of -1 means the metadata will be replicated only if some
+   other activity during the request (e.g. modifying an attribute) has
+   resulted in other replication work involving the session. A positive value
+   greater than the HttpSession.getMaxInactiveInterval() value will be treated 
+   as a likely misconfiguration and converted to 0; i.e. replicate the 
+   metadata on every request.
+-->
+<!ELEMENT max-unreplicated-interval (#PCDATA)>
+
+<!--
       Clustering only: Defines when the sessions are replicated to the other nodes.
       The typical value, "instant", replicates changes to the other nodes at the end 
       of requests, using the request processing thread to perform the replication. 

Modified: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/web/JBossWeb50UnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/web/JBossWeb50UnitTestCase.java	2008-07-10 21:41:35 UTC (rev 75640)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/web/JBossWeb50UnitTestCase.java	2008-07-10 21:54:47 UTC (rev 75641)
@@ -75,6 +75,8 @@
       assertTrue(replConfig.getReplicationFieldBatchMode().booleanValue());
       assertNotNull(replConfig.getUseJK());
       assertTrue(replConfig.getUseJK().booleanValue());
+      assertNotNull(replConfig.getMaxUnreplicatedInterval());
+      assertEquals(30, replConfig.getMaxUnreplicatedInterval().intValue());
       assertEquals(SnapshotMode.INTERVAL, replConfig.getSnapshotMode());
       assertNotNull(replConfig.getSnapshotInterval());
       assertEquals(5, replConfig.getSnapshotInterval().intValue());

Modified: projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/web/JBossWeb50_testClustering.xml
===================================================================
--- projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/web/JBossWeb50_testClustering.xml	2008-07-10 21:41:35 UTC (rev 75640)
+++ projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/web/JBossWeb50_testClustering.xml	2008-07-10 21:54:47 UTC (rev 75641)
@@ -10,6 +10,7 @@
       <replication-granularity>FIELD</replication-granularity>
       <replication-field-batch-mode>true</replication-field-batch-mode>
       <use-jk>true</use-jk>
+      <max-unreplicated-interval>30</max-unreplicated-interval>
       <snapshot-mode>INTERVAL</snapshot-mode>
       <snapshot-interval>5</snapshot-interval>
    </replication-config>




More information about the jboss-cvs-commits mailing list