[jboss-cvs] JBossAS SVN: r65977 - in projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache: impl and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 9 12:04:53 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-10-09 12:04:53 -0400 (Tue, 09 Oct 2007)
New Revision: 65977

Removed:
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/ItemInUseException.java
Modified:
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/Cache.java
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivationManager.java
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimpleIntegratedObjectStore.java
   projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java
Log:
Eliminate ItemInUseException.  No classes can leak from this project.

Modified: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/Cache.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/Cache.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/Cache.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -90,7 +90,7 @@
     * 
     * @param key    the identifier of the object
     * 
-    * @throws ItemInUseException if the object, or another object in the 
+    * @throws IllegalStateException if the object, or another object in the 
     *                            same {@link SerializationGroup} as the object, 
     *                            is in use. 
     * @throws UnsupportedOperationException if {@link #isClustered()} returns

Deleted: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/ItemInUseException.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/ItemInUseException.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/ItemInUseException.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -1,76 +0,0 @@
-/*
- * 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.ejb3.cache;
-
-/**
- * Exception indicating an object is "in use" and thus some action
- * on it is illegal.
- * 
- * @author Brian Stansberry
- * @version $Revision: 1.1 $
- */
-public class ItemInUseException extends IllegalStateException
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 0L;
-
-   /**
-    * Create a new ItemInUseException.
-    * 
-    */
-   public ItemInUseException()
-   {      
-   }
-
-   /**
-    * Create a new ItemInUseException.
-    * 
-    * @param s
-    */
-   public ItemInUseException(String s)
-   {
-      super(s);
-   }
-
-   /**
-    * Create a new ItemInUseException.
-    * 
-    * @param cause
-    */
-   public ItemInUseException(Throwable cause)
-   {
-      super(cause);
-   }
-
-   /**
-    * Create a new ItemInUseException.
-    * 
-    * @param message
-    * @param cause
-    */
-   public ItemInUseException(String message, Throwable cause)
-   {
-      super(message, cause);
-   }
-
-}

Modified: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -38,7 +38,7 @@
     * 
     * @param key    the identifier of the object
     * 
-    * @throws ItemInUseException if the object, or another object in the 
+    * @throws IllegalStateException if the object, or another object in the 
     *                            same {@link SerializationGroup} as the object, 
     *                            is in use. 
     */

Modified: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivationManager.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivationManager.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivationManager.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -45,9 +45,12 @@
     * 
     * @param obj    the object
     * 
-    * @throws ItemInUseException if <code>obj</code>, or another object in the 
+    * @throws IllegalStateException if <code>obj</code>, or another object in the 
     *                            same {@link SerializationGroup} as 
-    *                            <code>obj</code>, is in use. 
+    *                            <code>obj</code>, is in use. Checking if
+    *                            an object is in use and throwing this
+    *                            exception is not required, so callers should
+    *                            not assume it will be thrown.
     */
    void prePassivate(T obj);
    
@@ -76,9 +79,12 @@
     * 
     * @param obj    the object
     * 
-    * @throws ItemInUseException if <code>obj</code>, or another object in the 
+    * @throws IllegalStateException if <code>obj</code>, or another object in the 
     *                            same {@link SerializationGroup} as 
-    *                            <code>obj</code>, is in use. .
+    *                            <code>obj</code>, is in use. Checking if
+    *                            an object is in use and throwing this
+    *                            exception is not required, so callers should
+    *                            not assume it will be thrown.
     *                             
     * @throws UnsupportedOperationException if {@link #isClustered()} returns
     *                                       <code>false</code>

Modified: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimpleIntegratedObjectStore.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimpleIntegratedObjectStore.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimpleIntegratedObjectStore.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -30,7 +30,6 @@
 
 import org.jboss.ejb3.cache.Cacheable;
 import org.jboss.ejb3.cache.IntegratedObjectStore;
-import org.jboss.ejb3.cache.ItemInUseException;
 import org.jboss.ejb3.cache.ObjectStore;
 import org.jboss.ejb3.cache.PassivatingCache;
 import org.jboss.ejb3.cache.PassivatingIntegratedObjectStore;
@@ -208,9 +207,10 @@
                   remove(ts.getId());
                }
             }
-            catch (ItemInUseException ignored)
+            catch (IllegalStateException ise)
             {
-               log.trace("skipping in-use entry " + ts.getId());
+               // Not so great; we're assuming it's 'cause item's in use
+               log.trace("skipping in-use entry " + ts.getId(), ise);
             }
          }    
       }      
@@ -234,9 +234,10 @@
                   owningCache.passivate(ts.getId());
                }
             }
-            catch (ItemInUseException ignored)
+            catch (IllegalStateException ise)
             {
-               log.trace("skipping in-use entry " + ts.getId());
+               // Not so great; we're assuming it's 'cause item's in use
+               log.trace("skipping in-use entry " + ts.getId(), ise);
             }
          }
       }

Modified: projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java
===================================================================
--- projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java	2007-10-09 15:50:13 UTC (rev 65976)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java	2007-10-09 16:04:53 UTC (rev 65977)
@@ -27,7 +27,6 @@
 
 import org.jboss.ejb3.cache.Cacheable;
 import org.jboss.ejb3.cache.IntegratedObjectStore;
-import org.jboss.ejb3.cache.ItemInUseException;
 import org.jboss.ejb3.cache.PassivatingCache;
 import org.jboss.ejb3.cache.PassivatingIntegratedObjectStore;
 import org.jboss.ejb3.cache.PassivationManager;
@@ -87,7 +86,7 @@
          
          if(entry.isInUse())
          {
-            throw new ItemInUseException("entry " + entry + " is in use");
+            throw new IllegalStateException("entry " + entry + " is in use");
          }
          
          passivationManager.preReplicate(entry);
@@ -143,7 +142,7 @@
          
          if(entry.isInUse())
          {
-            throw new ItemInUseException("entry " + entry + " is in use");
+            throw new IllegalStateException("entry " + entry + " is in use");
          }
 
          passivationManager.prePassivate(entry);
@@ -202,7 +201,7 @@
       {
          entry = store.remove(key);
          if(entry.isInUse())
-            throw new ItemInUseException("entry " + entry + " is in use");
+            throw new IllegalStateException("entry " + entry + " is in use");
       }
       if(entry != null)
          factory.destroy(entry);




More information about the jboss-cvs-commits mailing list