[jboss-cvs] JBossAS SVN: r65276 - in trunk/ejb3/src/main/org/jboss/ejb3: cache/simple and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 10 06:00:16 EDT 2007


Author: wolfc
Date: 2007-09-10 06:00:16 -0400 (Mon, 10 Sep 2007)
New Revision: 65276

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java
   trunk/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java
   trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java
   trunk/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/SessionSynchronizationInterceptor.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java
Log:
EJBTHREE-1016: refactoring cache spi

Modified: trunk/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -124,8 +124,13 @@
       return entry;
    }
 
-   public void finished(StatefulBeanContext ctx)
+   public StatefulBeanContext peek(Object key) throws NoSuchEJBException
    {
+      return get(key, false);
+   }
+   
+   public void release(StatefulBeanContext ctx)
+   {
       synchronized (ctx)
       {
          ctx.setInUse(false);

Modified: trunk/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -35,11 +35,6 @@
 @Deprecated
 public interface StatefulCache extends Cache<StatefulBeanContext>
 {
-   /**
-    * returns a key not the actual object
-    */
-   public StatefulBeanContext create();
-
    public StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues);
 
    /**
@@ -93,13 +88,5 @@
    
    int getTotalSize();
    
-   public void remove(Object key);
-
-   public void finished(StatefulBeanContext ctx);
-
    public void initialize(Container container) throws Exception;
-
-   void start();
-
-   void stop();
 }

Modified: trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/cache/simple/SimpleStatefulCache.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -418,8 +418,13 @@
       return entry;
    }
 
-   public void finished(StatefulBeanContext ctx)
+   public StatefulBeanContext peek(Object key) throws NoSuchEJBException
    {
+      return get(key, false);
+   }
+   
+   public void release(StatefulBeanContext ctx)
+   {
       synchronized (ctx)
       {
          ctx.setInUse(false);

Modified: trunk/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -223,6 +223,11 @@
       return entry;
    }
 
+   public StatefulBeanContext peek(Object key) throws NoSuchEJBException
+   {
+      return get(key, false);
+   }
+   
    public void remove(Object key)
    {
       Fqn id = getFqn(key, false);
@@ -263,7 +268,7 @@
       }
    }
 
-   public void finished(StatefulBeanContext ctx)
+   public void release(StatefulBeanContext ctx)
    {
       synchronized (ctx)
       {

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/SessionSynchronizationInterceptor.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/SessionSynchronizationInterceptor.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/SessionSynchronizationInterceptor.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -97,7 +97,7 @@
          finally
          {
             StatefulContainer container = (StatefulContainer) ctx.getContainer();
-            container.getCache().finished(ctx);
+            container.getCache().release(ctx);
          }
       }
    }

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -88,6 +88,8 @@
 
    public StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues)
    {
+      // FIXME: this method is not finished. In the old setup the call would go
+      // through Pool which would call the init method.
       return (StatefulBeanContext) createBeanContext();
    }
    

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java	2007-09-10 09:45:16 UTC (rev 65275)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulInstanceInterceptor.java	2007-09-10 10:00:16 UTC (rev 65276)
@@ -101,7 +101,7 @@
          synchronized (target)
          {
             target.setInInvocation(false);
-            if (!target.isTxSynchronized() && !target.isDiscarded()) container.getCache().finished(target);
+            if (!target.isTxSynchronized() && !target.isDiscarded()) container.getCache().release(target);
             if (block) target.getLock().unlock();
          }
       }




More information about the jboss-cvs-commits mailing list