Author: manik.surtani(a)jboss.com
Date: 2008-05-14 06:24:03 -0400 (Wed, 14 May 2008)
New Revision: 5838
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
Log:
Updated
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-05-14 09:59:57 UTC
(rev 5837)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-05-14 10:24:03 UTC
(rev 5838)
@@ -52,11 +52,17 @@
{
this.configuration = configuration;
this.nodeFactory = nodeFactory;
+
+ // We need to create a root node even at this stage since certain components rely
on this being available before
+ // start() is called.
+ // TODO: Investigate which components rely on this being available before start(),
and why!
+ createRootNode();
}
@Start(priority = 12)
public void createRootNode()
{
+ if (trace) log.trace("Starting data container");
// create a new root temporarily.
NodeSPI tempRoot = nodeFactory.createRootDataNode();
// if we don't already have a root or the new (temp) root is of a different
class (optimistic vs pessimistic) to
@@ -65,7 +71,11 @@
Class currentRootType = root == null ? null : ((NodeInvocationDelegate)
root).getDelegationTarget().getClass();
Class tempRootType = ((NodeInvocationDelegate)
tempRoot).getDelegationTarget().getClass();
- if (!tempRootType.equals(currentRootType)) setRoot(tempRoot);
+ if (!tempRootType.equals(currentRootType))
+ {
+ if (trace) log.trace("Setting root node to an instance of " +
tempRootType);
+ setRoot(tempRoot);
+ }
}
@Stop(priority = 100)