[jboss-cvs] JBossAS SVN: r65953 - projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 8 23:34:28 EDT 2007
Author: bstansberry at jboss.com
Date: 2007-10-08 23:34:28 -0400 (Mon, 08 Oct 2007)
New Revision: 65953
Modified:
projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java
Log:
Pass ref to ourself to store
Mark objects in use
Don't invoke callbacks in peek
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 03:33:30 UTC (rev 65952)
+++ projects/ejb3/branches/cluster-dev/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache2.java 2007-10-09 03:34:28 UTC (rev 65953)
@@ -29,6 +29,7 @@
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;
import org.jboss.ejb3.cache.StatefulObjectFactory;
import org.jboss.logging.Logger;
@@ -57,6 +58,10 @@
this.factory = factory;
this.passivationManager = passivationManager;
this.store = store;
+ if (store instanceof PassivatingIntegratedObjectStore)
+ {
+ ((PassivatingIntegratedObjectStore<T>) store).setPassivatingCache(this);
+ }
}
public boolean isClustered()
@@ -94,6 +99,7 @@
public T create(Class<?>[] initTypes, Object[] initValues)
{
T obj = factory.create(initTypes, initValues);
+ obj.setInUse(true);
synchronized (store)
{
store.insert(obj);
@@ -154,12 +160,16 @@
if(entry == null)
throw new NoSuchEJBException(String.valueOf(key));
- if (isClustered())
- {
- passivationManager.postReplicate(entry);
- }
+ // TODO why call these in peek? We should *always* call
+ // them in get() and let the PassivationManager sort out
+ // whether they really need to be called
- passivationManager.postActivate(entry);
+// if (isClustered())
+// {
+// passivationManager.postReplicate(entry);
+// }
+//
+// passivationManager.postActivate(entry);
return entry;
}
More information about the jboss-cvs-commits
mailing list