[jboss-cvs] JBossAS SVN: r65351 - trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 12 23:22:11 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-09-12 23:22:11 -0400 (Wed, 12 Sep 2007)
New Revision: 65351

Added:
   trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/PassivationConfig.java
Modified:
   trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java
   trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/ReplicationConfig.java
   trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/WebDD.java
Log:
Sync up with WebMetaData impl

Modified: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java	2007-09-13 03:21:37 UTC (rev 65350)
+++ trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/JBossWebDDObjectFactory.java	2007-09-13 03:22:11 UTC (rev 65351)
@@ -124,6 +124,8 @@
          child = new Servlet();
       else if (localName.equals("replication-config"))
          child = new ReplicationConfig();
+      else if (localName.equals("passivation-config"))
+         child = new ReplicationConfig();
       else if (localName.equals("message-destination"))
       {
          child = new MessageDestination();
@@ -136,6 +138,11 @@
       parent.setReplicationConfig(config);
    }
 
+   public void addChild(WebDD parent, PassivationConfig config, UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setPassivationConfig(config);
+   }
+
    public void addChild(WebDD parent, EjbLocalRef ref, UnmarshallingContext navigator, String namespaceURI, String localName)
    {
       parent.updateEjbLocalRef(ref);
@@ -238,8 +245,40 @@
       {
          config.setFieldBatchMode(value);
       }
+      else if (localName.equals("cache-name"))
+      {
+         config.setCacheName(value);
+      }
+      else if (localName.equals("snapshot-mode"))
+      {
+         config.setSnapshotMode(value);         
+      }
+      else if (localName.equals("snapshot-interval"))
+      {
+         config.setSnapshotInterval(value);
+      }
+      else if (localName.equals("use-jk"))
+      {
+         config.setUseJK(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, String value)
    {
       if (localName.equals("servlet-name"))

Added: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/PassivationConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/PassivationConfig.java	                        (rev 0)
+++ trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/PassivationConfig.java	2007-09-13 03:22:11 UTC (rev 65351)
@@ -0,0 +1,95 @@
+/*
+* 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.web.metamodel.descriptor;
+
+import java.io.Serializable;
+
+import org.jboss.logging.Logger;
+
+
+/**
+ * Represents a <passivation-config> element of the jboss-web.xml 
+ * deployment descriptor 
+ *
+ * @author Brian Stansberry
+ * @version <tt>$Revision$</tt>
+ */
+public class PassivationConfig
+   implements Serializable
+{  
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 107046298420138708L;
+
+   private static final Logger log = Logger.getLogger(PassivationConfig.class);
+   private static final String IGNORE = "-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. 
+    */
+   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 == null ? IGNORE : passivationMaxIdleTime;
+   }
+
+   public void setPassivationMaxIdleTime(String passivationMaxIdleTime)
+   {
+      this.passivationMaxIdleTime = passivationMaxIdleTime;
+   }
+
+   public String getPassivationMinIdleTime()
+   {
+      return passivationMinIdleTime == null ? IGNORE : passivationMinIdleTime;
+   }
+
+   public void setPassivationMinIdleTime(String passivationMinIdleTime)
+   {
+      this.passivationMinIdleTime = passivationMinIdleTime;
+   }
+
+   public String getUseSessionPassivation()
+   {
+      return useSessionPassivation;
+   }
+
+   public void setUseSessionPassivation(String useSessionPassivation)
+   {
+      this.useSessionPassivation = useSessionPassivation;
+   }
+   
+}


Property changes on: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/PassivationConfig.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Modified: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/ReplicationConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/ReplicationConfig.java	2007-09-13 03:21:37 UTC (rev 65350)
+++ trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/ReplicationConfig.java	2007-09-13 03:22:11 UTC (rev 65351)
@@ -36,6 +36,12 @@
    protected String trigger;
    protected String granularity;
    protected String fieldBatchMode;
+   protected String defaultCacheName;
+   protected String cacheName;
+   protected String useJK;
+   protected String snapshotMode;
+   protected String snapshotInterval;
+   protected String useLocalCache;
    
    public String getTrigger()
    {
@@ -67,9 +73,115 @@
       this.fieldBatchMode = fieldBatchMode;
    }
 
+   public String getCacheName()
+   {
+      return cacheName;
+   }
+
+   public void setCacheName(String cacheName)
+   {
+      this.cacheName = cacheName;
+   }
+
+   public String getDefaultCacheName()
+   {
+      return defaultCacheName;
+   }
+
+   public void setDefaultCacheName(String defaultCacheName)
+   {
+      this.defaultCacheName = defaultCacheName;
+   }
+
+   public String getSnapshotInterval()
+   {
+      return snapshotInterval;
+   }
+
+   public void setSnapshotInterval(String snapshotInterval)
+   {
+      this.snapshotInterval = snapshotInterval;
+   }
+
+   public String getSnapshotMode()
+   {
+      return snapshotMode;
+   }
+
+   public void setSnapshotMode(String snapshotMode)
+   {
+      this.snapshotMode = snapshotMode;
+   }
+
+   public String getUseJK()
+   {
+      return useJK;
+   }
+
+   public void setUseJK(String useJK)
+   {
+      this.useJK = useJK;
+   }
+
+   public String getUseLocalCache()
+   {
+      return useLocalCache;
+   }
+
+   public void setUseLocalCache(String useLocalCache)
+   {
+      this.useLocalCache = useLocalCache;
+   }
+   
+   public void setDefaultSnapshotMode(String mode)
+   {
+      if (isEmpty(snapshotMode))
+      {
+         snapshotMode = mode;
+      }
+   }
+   
+   public void setDefaultSnapshotInterval(int interval)
+   {
+      if (isEmpty(snapshotInterval))
+      {
+         snapshotInterval = String.valueOf(interval);
+      }
+   }
+   
+   public void setDefaultUseJK(boolean useJK)
+   {
+      if (isEmpty(this.useJK))
+      {
+         this.useJK = String.valueOf(useJK);
+      }
+   }
+   
+   public void setDefaultUseLocalCache(boolean useLocal)
+   {
+      if (isEmpty(this.useLocalCache))
+      {
+         this.useLocalCache = String.valueOf(useLocal);
+      }
+   }
+
    public String toString()
    {
       StringBuffer sb = new StringBuffer(100);
+      sb.append("cacheName=").append(cacheName)
+        .append(";defaultCacheName=").append(defaultCacheName)
+        .append(";granularity=").append(granularity)
+        .append(";trigger=").append(trigger)
+        .append(";fieldBatchMode=").append(fieldBatchMode)
+        .append(";useJK=").append(useJK)
+        .append(";snapshotMode=").append(snapshotMode)
+        .append(";snapshotInterval=").append(snapshotInterval)
+        .append(";useLocalCache=").append(useLocalCache);
       return sb.toString();
    }
+   
+   private static boolean isEmpty(String str)
+   {
+      return str == null || str.trim().length() == 0;
+   }
 }

Modified: trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/WebDD.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/WebDD.java	2007-09-13 03:21:37 UTC (rev 65350)
+++ trunk/tomcat/src/main/org/jboss/web/metamodel/descriptor/WebDD.java	2007-09-13 03:22:11 UTC (rev 65351)
@@ -55,6 +55,7 @@
    protected HashMap messageDestinations = new HashMap();
    protected List dependencies = new ArrayList();
    protected ReplicationConfig replicationConfig;
+   protected PassivationConfig passivationConfig;
    
    public String getSecurityDomain()
    {
@@ -236,6 +237,16 @@
       this.replicationConfig = replicationConfig;
    }
    
+   public PassivationConfig getPassivationConfig()
+   {
+      return passivationConfig;
+   }
+
+   public void setPassivationConfig(PassivationConfig passivationConfig)
+   {
+      this.passivationConfig = passivationConfig;
+   }
+
    public String toString()
    {
       StringBuffer sb = new StringBuffer(100);




More information about the jboss-cvs-commits mailing list