[jboss-cvs] JBossAS SVN: r67676 - in projects/metadata/trunk/src/main: resources/dtd and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 30 19:16:00 EST 2007


Author: bstansberry at jboss.com
Date: 2007-11-30 19:16:00 -0500 (Fri, 30 Nov 2007)
New Revision: 67676

Modified:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/PassivationConfig.java
   projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd
Log:
[JBAS-5027] Support object passivation with FIELD granularity clustered webapps

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/PassivationConfig.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/PassivationConfig.java	2007-11-30 23:07:27 UTC (rev 67675)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/web/jboss/PassivationConfig.java	2007-12-01 00:16:00 UTC (rev 67676)
@@ -35,54 +35,132 @@
    /** The serialVersionUID */
    private static final long serialVersionUID = 1;
 
-   /**
-    * If true then the session passivation is enabled for this web app.
-    * If false then the session passivation is disabled for this web app. 
-    */
    private Boolean useSessionPassivation;
    
-   /**
-    * Min time (seconds) the session must be idle since lastAccesstime before it's eligable for passivation
-    * This overrides maxActive_, to prevent thrashing if the there are lots of active sessions.
-    * Setting to -1 means it's ignored
-    */
    private Integer passivationMinIdleTime;
    
+   private Integer passivationMaxIdleTime;
+   
+   private Integer maxObjects;
+   
+   private Integer objectMaxIdleTime;
+
    /**
-    * Max time (seconds) the session must be idle since lastAccesstime before it's eligable for passivation
-    * This overrides maxActive_, to prevent thrashing if the there are lots of active sessions.
-    * Setting to -1 means session should not be forced out.
+    * Gets the max time (seconds) the session must be idle after which it's 
+    * eligible for passivation whether or not maxActiveSessions has been reached.
     */
-   private Integer passivationMaxIdleTime;
-
    public Integer getPassivationMaxIdleTime()
    {
       return passivationMaxIdleTime;
    }
 
+   /**
+    * Sets the max time (seconds) the session must be idle after which it's 
+    * eligible for passivation whether or not maxActiveSessions has been reached.
+    */
    public void setPassivationMaxIdleTime(Integer passivationMaxIdleTime)
    {
       this.passivationMaxIdleTime = passivationMaxIdleTime;
    }
 
+   /**
+    * Gets the min time (seconds) a session must be idle before it's eligible for passivation.
+    * This overrides the maxActiveSessions config, to prevent thrashing if the there are lots of active sessions.
+    * Setting to -1 means it's ignored
+    */
    public Integer getPassivationMinIdleTime()
    {
       return passivationMinIdleTime;
    }
 
+   /**
+    * Sets the min time (seconds) a session must be idle before it's eligible for passivation.
+    * This overrides the maxActiveSessions config, to prevent thrashing if the there are lots of active sessions.
+    * Setting to -1 means it's ignored
+    */
    public void setPassivationMinIdleTime(Integer passivationMinIdleTime)
    {
       this.passivationMinIdleTime = passivationMinIdleTime;
    }
 
+   /**
+    * Gets whether passivation is enabled for this webapp.
+    */
    public Boolean getUseSessionPassivation()
    {
       return useSessionPassivation;
    }
 
+   /**
+    * Sets whether passivation is enabled for this webapp.
+    */
    public void setUseSessionPassivation(Boolean useSessionPassivation)
    {
       this.useSessionPassivation = useSessionPassivation;
    }
+
+   /**
+    * Gets the maximum number of cached {@link ReplicationGranularity.FIELD} 
+    * session attribute objects before the session management 
+    * layer should begin passivating them to persistent storage.
+    * 
+    * @return the maximum number of objects, or <code>null</code>
+    */
+   public Integer getMaxObjects()
+   {
+      return maxObjects;
+   }
+
+   /**
+    * Sets the maximum number of cached {@link ReplicationGranularity.FIELD} 
+    * session attribute objects before the session management 
+    * layer should begin passivating them to persistent storage.
+    * 
+    * @param maxObjects the maximum number of objects. Note that if a complex 
+    *                   object graph is passed to setAttribute(), the number of 
+    *                   cached objects is increased by the number of objects in 
+    *                   the graph, not by 1. Primitive objects 
+    *                   (i.e. java.lang.String, java.lang.Number) included 
+    *                   within a complex object graph do not increase the total.
+    *                   If set to <code>null</code> or a value less than one,
+    *                   the number of objects is not considered. 
+    */
+   public void setMaxObjects(Integer maxObjects)
+   {
+      this.maxObjects = maxObjects;
+   }
+
+   /**
+    * Gets the maximum time (in seconds) cached 
+    * {@link ReplicationGranularity.FIELD} session 
+    * attribute objects can remain unaccessed before the session management 
+    * layer should begin passivating them to persistent storage.  Only
+    * relevant if {@link ReplicationGranularity.FIELD} is used.
+    * 
+    * @return the maximum idle time, or <code>null</code>. A value less than
+    *         <code>1</code> means object idle time should not be considered.
+    */
+   public Integer getObjectMaxIdleTime()
+   {
+      return objectMaxIdleTime;
+   }
+
+   /**
+    * Sets the maximum time (in seconds) cached 
+    * {@link ReplicationGranularity.FIELD} session 
+    * attribute objects can remain unaccessed before the session management 
+    * layer should begin passivating them to persistent storage.  Only
+    * relevant if {@link ReplicationGranularity.FIELD} is used.
+    * 
+    * @param objectIdleTime the maximum idle time. A value of <code>null</code> 
+    *                       or less than <code>1</code> means object idle time 
+    *                       should not be considered.
+    */
+   public void setObjectMaxIdleTime(Integer objectMaxIdleTime)
+   {
+      this.objectMaxIdleTime = objectMaxIdleTime;
+   }
    
+   
+   
 }

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	2007-11-30 23:07:27 UTC (rev 67675)
+++ projects/metadata/trunk/src/main/resources/dtd/jboss-web_5_0.dtd	2007-12-01 00:16:00 UTC (rev 67676)
@@ -302,9 +302,9 @@
 <!ELEMENT max-active-sessions (#PCDATA)>
 
 <!--
-   HTTP Session passivation configuration (optional tags)
+   Clustering only: HTTP Session passivation configuration. (optional tags)
 -->
-<!ELEMENT passivation-config (use-session-passivation?, passivation-min-idle-time, passivation-max-idle-time)>
+<!ELEMENT passivation-config (use-session-passivation?, passivation-min-idle-time, passivation-max-idle-time, max-objects?, object-max-idle-time?)>
 
 <!--
    Clustering only: Determines whether the web application should use session passivation or not
@@ -344,6 +344,46 @@
 -->
 <!ELEMENT passivation-max-idle-time (#PCDATA)>
 
+<!-- Clustering only, and only if replication-granularity is FIELD:
+     Determines the maximum number of cached session attribute objects 
+     (i.e. objects stored in the webapp's sessions by calling 
+     HttpSession.setAttribute(String, Object)) before the session management
+     layer should begin passivating objects to persistent storage.  Objects
+     are passivated using an LRU algorithm. Note that if a complex object graph
+     is passed to setAttribute(), the number of cached objects is increased by 
+     the number of objects in the graph, not by 1. Primitive objects
+     (i.e. java.lang.String, java.lang.Number) included within a complex object 
+     graph do not increase the total. 
+     
+     FIELD replication granularity supports sharing references to objects 
+     between sessions.  As a result, passivation of objects stored in a session
+     is not done when the session itself is passivated.  Instead, with FIELD
+     replication granularity, passivation of session objects is controlled via
+     this element and the object-max-idle-time element.
+      
+     A value of less than 1 disables passivation of session attribute objects 
+     based on the number of objects. The default is -1.
+-->
+<!ELEMENT max-objects (#PCDATA)>
+
+<!-- Clustering only, and only if replication-granularity is FIELD:
+     Determines the maximum time (in seconds) cached session attribute objects 
+     (i.e. objects stored in the webapp's sessions by calling 
+     HttpSession.setAttribute(String, Object)) can remain unaccessed before the 
+     session management layer should begin passivating them to persistent storage.
+     Objects are passivated using an LRU algorithm.
+     
+     FIELD replication granularity supports sharing references to objects 
+     between sessions.  As a result, passivation of objects stored in a session
+     is not done when the session itself is passivated.  Instead, with FIELD
+     replication granularity, passivation of session objects is controlled via
+     this element and the max-objects element.
+      
+     A value of less than 1 disables passivation of session attribute objects 
+     based on idle time. The default is -1.
+-->
+<!ELEMENT object-max-idle-time (#PCDATA)>
+
 <!--
    HTTP Session clustering configuration (optional tags)
 -->




More information about the jboss-cvs-commits mailing list