[jboss-cvs] JBossAS SVN: r58547 - in trunk/server/src/main/org/jboss/metadata: . web

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 18 06:15:28 EST 2006


Author: bstansberry at jboss.com
Date: 2006-11-18 06:15:25 -0500 (Sat, 18 Nov 2006)
New Revision: 58547

Added:
   trunk/server/src/main/org/jboss/metadata/web/PassivationConfig.java
Modified:
   trunk/server/src/main/org/jboss/metadata/WebMetaData.java
   trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java
Log:
Add passivation configuration

Modified: trunk/server/src/main/org/jboss/metadata/WebMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2006-11-18 11:15:03 UTC (rev 58546)
+++ trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2006-11-18 11:15:25 UTC (rev 58547)
@@ -40,6 +40,7 @@
 import org.jboss.metadata.web.FilterMapping;
 import org.jboss.metadata.web.LoginConfig;
 import org.jboss.metadata.web.ParamValue;
+import org.jboss.metadata.web.PassivationConfig;
 import org.jboss.metadata.web.ReplicationConfig;
 import org.jboss.metadata.web.Servlet;
 import org.jboss.metadata.web.ServletMapping;
@@ -107,6 +108,7 @@
    protected HashMap<String, ErrorPage> errorPages = new HashMap<String, ErrorPage>();
    protected List<String> dependencies = new ArrayList<String>();
    protected ReplicationConfig replicationConfig;
+   protected PassivationConfig passivationConfig;
 
    /** web.xml env-entrys */
    private ArrayList<EnvEntryMetaData> environmentEntries = new ArrayList<EnvEntryMetaData>();
@@ -496,7 +498,16 @@
       this.replicationConfig = replicationConfig;
    }
 
+   public PassivationConfig getPassivationConfig()
+   {
+      return passivationConfig;
+   }
 
+   public void setPassivationConfig(PassivationConfig passivationConfig)
+   {
+      this.passivationConfig = passivationConfig;
+   }
+
    /** Return an iterator of the env-entry mappings.
     @return Iterator of EnvEntryMetaData objects.
     */

Modified: trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java	2006-11-18 11:15:03 UTC (rev 58546)
+++ trunk/server/src/main/org/jboss/metadata/web/JBossWebMetaDataObjectFactory.java	2006-11-18 11:15:25 UTC (rev 58547)
@@ -126,6 +126,8 @@
          child = new Servlet();
       else if (localName.equals("replication-config"))
          child = new ReplicationConfig();
+      else if (localName.equals("passivation-config"))
+         child = new PassivationConfig();
       else if (localName.equals("message-destination"))
       {
          child = new MessageDestinationMetaData();
@@ -139,6 +141,12 @@
       parent.setReplicationConfig(config);
    }
 
+   public void addChild(WebMetaData parent, PassivationConfig config,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setPassivationConfig(config);
+   }
+
    public void addChild(WebMetaData parent, EjbLocalRefMetaData ref,
                         UnmarshallingContext navigator, String namespaceURI, String localName)
    {
@@ -242,6 +250,24 @@
          config.setFieldBatchMode(value);
       }
    }
+   
+   public void setValue(PassivationConfig config,
+                        UnmarshallingContext navigator, String namespaceURI, String localName,
+                        String value)
+   {
+      if (localName.equals("use-session-passivation"))
+      {
+         config.setUseSessionPassivation(value);
+      }
+      else if (localName.equals("passivation-min-idle-time"))
+      {
+         config.setPassivationMinIdleTime(value);
+      }
+      else if (localName.equals("passivation-max-idle-time"))
+      {
+         config.setPassivationMaxIdleTime(value);
+      }
+   }
 
    public void setValue(Servlet servlet,
                         UnmarshallingContext navigator, String namespaceURI, String localName,

Added: trunk/server/src/main/org/jboss/metadata/web/PassivationConfig.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/PassivationConfig.java	2006-11-18 11:15:03 UTC (rev 58546)
+++ trunk/server/src/main/org/jboss/metadata/web/PassivationConfig.java	2006-11-18 11:15:25 UTC (rev 58547)
@@ -0,0 +1,88 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.metadata.web;
+
+import org.jboss.logging.Logger;
+
+
+/**
+ * Represents a <passivation-config> element of the jboss-web.xml 
+ * deployment descriptor 
+ *
+ * @author Brian Stansberry
+ * @version <tt>$Revision: 45417 $</tt>
+ */
+public class PassivationConfig
+{
+   private static final Logger log = Logger.getLogger(PassivationConfig.class);
+   
+   /**
+    * If true then the session passivation is enabled for this web app.
+    * If false then the session passivation is disabled for this web app. 
+    */
+   protected String 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
+    */
+   protected String passivationMinIdleTime;
+   
+   /**
+    * 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.
+    */
+   protected String passivationMaxIdleTime;
+
+   public String getPassivationMaxIdleTime()
+   {
+      return passivationMaxIdleTime;
+   }
+
+   public void setPassivationMaxIdleTime(String passivationMaxIdleTime)
+   {
+      this.passivationMaxIdleTime = passivationMaxIdleTime;
+   }
+
+   public String getPassivationMinIdleTime()
+   {
+      return passivationMinIdleTime;
+   }
+
+   public void setPassivationMinIdleTime(String passivationMinIdleTime)
+   {
+      this.passivationMinIdleTime = passivationMinIdleTime;
+   }
+
+   public String getUseSessionPassivation()
+   {
+      return useSessionPassivation;
+   }
+
+   public void setUseSessionPassivation(String useSessionPassivation)
+   {
+      this.useSessionPassivation = useSessionPassivation;
+   }
+   
+}




More information about the jboss-cvs-commits mailing list