[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Elias Ross
genman at noderunner.net
Wed Nov 29 17:10:22 EST 2006
User: genman
Date: 06/11/29 17:10:22
Modified: src/org/jboss/cache/interceptors
ActivationInterceptor.java
CacheLoaderInterceptor.java
PassivationInterceptor.java
Log:
JBCACHE-888 - Remove TreeCache.UNITIALIZED
Revision Changes Path
1.42 +4 -4 JBossCache/src/org/jboss/cache/interceptors/ActivationInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ActivationInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/ActivationInterceptor.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- ActivationInterceptor.java 23 Nov 2006 19:43:05 -0000 1.41
+++ ActivationInterceptor.java 29 Nov 2006 22:10:22 -0000 1.42
@@ -27,7 +27,7 @@
* their attributes have been initialized and their children have been loaded in memory.
*
* @author <a href="mailto:{hmesha at novell.com}">{Hany Mesha}</a>
- * @version $Id: ActivationInterceptor.java,v 1.41 2006/11/23 19:43:05 genman Exp $
+ * @version $Id: ActivationInterceptor.java,v 1.42 2006/11/29 22:10:22 genman Exp $
*/
public class ActivationInterceptor extends CacheLoaderInterceptor implements ActivationInterceptorMBean
{
@@ -162,7 +162,7 @@
// Then notify the listeners that the node has been activated.
Node n = getNode(fqn); // don't load
// node not null and attributes have been loaded?
- if (n != null && !n.getKeys().contains(TreeCache.UNINITIALIZED))
+ if (n != null && n.getNodeSPI().getDataLoaded())
{
if (!n.getChildren().isEmpty())
{
@@ -203,7 +203,7 @@
for (Node child : n.getChildren())
{
- if (child.getKeys().contains(TreeCache.UNINITIALIZED))
+ if (!child.getNodeSPI().getDataLoaded())
return false;
}
return true;
@@ -307,7 +307,7 @@
{
Node n = getNode(fqn); // don't load
// node not null and attributes have been loaded?
- if (n != null && !n.getKeys().contains(TreeCache.UNINITIALIZED))
+ if (n != null && n.getNodeSPI().getDataLoaded())
{
// has children?
if (!n.getChildren().isEmpty() && allInitialized(n))
1.63 +9 -11 JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLoaderInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheLoaderInterceptor.java,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- CacheLoaderInterceptor.java 25 Nov 2006 02:38:51 -0000 1.62
+++ CacheLoaderInterceptor.java 29 Nov 2006 22:10:22 -0000 1.63
@@ -33,7 +33,7 @@
* Loads nodes that don't exist at the time of the call into memory from the CacheLoader
*
* @author Bela Ban
- * @version $Id: CacheLoaderInterceptor.java,v 1.62 2006/11/25 02:38:51 genman Exp $
+ * @version $Id: CacheLoaderInterceptor.java,v 1.63 2006/11/29 22:10:22 genman Exp $
*/
public class CacheLoaderInterceptor extends BaseCacheLoaderInterceptor implements CacheLoaderInterceptorMBean
{
@@ -297,10 +297,11 @@
{
// load data for children as well!
childMap.putAll(loader.get(child.getFqn()));
+ child.getNodeSPI().setDataLoaded(true);
}
else
{
- childMap.put(TreeCache.UNINITIALIZED, null);
+ child.getNodeSPI().setDataLoaded(false);
}
if (recursive)
{
@@ -317,7 +318,7 @@
log.trace("mustLoad, node null");
return true;
}
- if (n.getKeys().contains(TreeCache.UNINITIALIZED)) {
+ if (!n.getNodeSPI().getDataLoaded()) {
log.trace("must Load, uninitialized");
return true;
}
@@ -430,10 +431,9 @@
cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
n.put(nodeData);
}
- else if (n != null && n.getKeys().contains(TreeCache.UNINITIALIZED))
+ else if (n != null && !n.getNodeSPI().getDataLoaded())
{
- cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
- n.remove(TreeCache.UNINITIALIZED);
+ n.getNodeSPI().setDataLoaded(true);
}
return n;
}
@@ -444,8 +444,7 @@
private Node createTempNode(Fqn fqn, TransactionEntry entry) throws Exception
{
Node n = createNodes(fqn, entry);
- cache.getInvocationContext().getOptionOverrides().setBypassInterceptorChain(true);
- n.put(TreeCache.UNINITIALIZED, null);
+ n.getNodeSPI().setDataLoaded(false);
if (log.isTraceEnabled())
{
log.trace("createTempNode n " + n);
@@ -478,15 +477,14 @@
if (last)
{
child_node = n.addChild(new Fqn(child_name));
+ child_node.getNodeSPI().setDataLoaded(true);
//child_node = n.createChild(child_name, tmp_fqn, n);
}
else
{
//child_node = n.createChild(child_name, tmp_fqn, n, TreeCache.UNINITIALIZED, null);
child_node = n.addChild(new Fqn(child_name));
- o = cache.getInvocationContext().getOptionOverrides();
- o.setBypassInterceptorChain(true);
- child_node.put(TreeCache.UNINITIALIZED, null);
+ child_node.getNodeSPI().setDataLoaded(false);
}
if (entry != null)
1.33 +1 -7 JBossCache/src/org/jboss/cache/interceptors/PassivationInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PassivationInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/PassivationInterceptor.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- PassivationInterceptor.java 20 Nov 2006 03:53:54 -0000 1.32
+++ PassivationInterceptor.java 29 Nov 2006 22:10:22 -0000 1.33
@@ -18,7 +18,7 @@
* CacheLoader, either before each method call (no TXs), or at TX commit.
*
* @author <a href="mailto:{hmesha at novell.com}">{Hany Mesha}</a>
- * @version $Id: PassivationInterceptor.java,v 1.32 2006/11/20 03:53:54 genman Exp $
+ * @version $Id: PassivationInterceptor.java,v 1.33 2006/11/29 22:10:22 genman Exp $
*/
public class PassivationInterceptor extends Interceptor implements PassivationInterceptorMBean
{
@@ -57,12 +57,6 @@
// evict method local doesn't hold attributes therefore we have
// to get them manually
Map attributes = getNodeAttributes(fqn);
-
- // remove internal flag if node was never fully loaded
- if (attributes != null)
- {
- attributes.remove(TreeCache.UNINITIALIZED);
- }
// notify listeners that this node is about to be passivated
cache.getNotifier().notifyNodePassivated(fqn, true);
More information about the jboss-cvs-commits
mailing list