[jboss-cvs] JBossAS SVN: r58582 - trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 18 06:40:31 EST 2006


Author: bstansberry at jboss.com
Date: 2006-11-18 06:40:30 -0500 (Sat, 18 Nov 2006)
New Revision: 58582

Added:
   trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/InvalidateSessionPolicy.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/ReplicationGranularity.java
Log:
Add enums for config options

Added: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/InvalidateSessionPolicy.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/InvalidateSessionPolicy.java	2006-11-18 11:40:14 UTC (rev 58581)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/InvalidateSessionPolicy.java	2006-11-18 11:40:30 UTC (rev 58582)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.tomcat.tc6.session;
+
+public enum InvalidateSessionPolicy
+{
+   ACCESS, SET_AND_GET, SET_AND_NON_PRIMITIVE_GET, SET;
+   
+   public static InvalidateSessionPolicy fromString(String policy)
+   {
+      return (policy == null ? InvalidateSessionPolicy.SET_AND_NON_PRIMITIVE_GET 
+                             : Enum.valueOf(InvalidateSessionPolicy.class, policy));   
+   }
+   
+   public static InvalidateSessionPolicy fromInt(int ordinal)
+   {
+      switch (ordinal)
+      {
+         case 2:
+            return SET_AND_NON_PRIMITIVE_GET;
+         case 3:
+            return SET;
+         case 1:
+            return SET_AND_GET;
+         case 0:
+            return ACCESS;
+         default:
+            throw new IllegalArgumentException("Unknown ordinal " + ordinal);
+      }
+   }
+}
\ No newline at end of file

Added: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/ReplicationGranularity.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/ReplicationGranularity.java	2006-11-18 11:40:14 UTC (rev 58581)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/session/ReplicationGranularity.java	2006-11-18 11:40:30 UTC (rev 58582)
@@ -0,0 +1,33 @@
+/*
+* 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.tomcat.tc6.session;
+
+public enum ReplicationGranularity 
+{
+   SESSION, ATTRIBUTE, FIELD;  
+
+   public static ReplicationGranularity fromString(String granularity)
+   {
+      return (granularity == null ? SESSION 
+                                  : Enum.valueOf(ReplicationGranularity.class, granularity));
+   }
+}




More information about the jboss-cvs-commits mailing list