[jbosscache-commits] JBoss Cache SVN: r5718 - in core/trunk/src/main/java/org/jboss/cache: commands/read and 2 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Apr 28 08:18:53 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-04-28 08:18:52 -0400 (Mon, 28 Apr 2008)
New Revision: 5718

Modified:
   core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
   core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
Log:
worked on todos

Modified: core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java	2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java	2008-04-28 12:18:52 UTC (rev 5718)
@@ -196,9 +196,6 @@
       removeConfigurationDependentComponents();
 
       // this will recreate any missing components based on the current config
-      //todo [mmarkus] updateDependencies should be moved in this class. Component registry's is not to care
-      // todo about particular instances that are manipulated there ; it should be keept generic
-      // todo [MANIK] NOT true.  The ComponentRegistry is a state machine and is responsible for maintaining states and dependencies.
       componentRegistry.updateDependencies();
       componentRegistry.wireDependencies(cacheData.getRoot());
 
@@ -207,15 +204,9 @@
       // start all internal components
       componentRegistry.start();
 
-      //todo this is important info that needs to be printed, add it somewhere ...
-//      if (log.isDebugEnabled())
-      //log.debug("ChainedInterceptor chain is:\n" + CachePrinter.printInterceptorChain(cacheCommand));
+      if (log.isDebugEnabled())
+         log.debug("Interceptor chain is: " + componentRegistry.getComponent(InterceptorChain.class));
 
-//      if (configuration.getNodeLockingScheme() == Configuration.NodeLockingScheme.OPTIMISTIC && transactionManager == null)
-//      {
-//         log.fatal("No transaction manager lookup class has been defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used!  Expect errors!!");
-//      }
-
       correctRootNodeType();
 
       switch (configuration.getCacheMode())

Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java	2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java	2008-04-28 12:18:52 UTC (rev 5718)
@@ -10,11 +10,12 @@
  * Does not acquire any locks in doing so (result may be dirty read). Does
  * not attempt to load nodes from a cache loader (may return false if a
  * node has been evicted).
+ * <p/>
+ * Specifically used by the {@link org.jboss.cache.loader.ClusteredCacheLoader} to implement {@link org.jboss.cache.loader.CacheLoader#exists(org.jboss.cache.Fqn)}
+ * <p/>
  *
  * @author Mircea.Markus at jboss.com
  * @since 2.2
- *        todo - this is only used when remote cache calls exists, nut sure it is necessary to have it as a command
- *        todo- see if this is used at all!!
  */
 public class RemoteExistsCommand extends AbstractDataCommand
 {

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java	2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java	2008-04-28 12:18:52 UTC (rev 5718)
@@ -8,6 +8,7 @@
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.interceptors.base.VisitorInterceptor;
 import org.jboss.cache.invocation.InvocationContextContainer;
+import org.jboss.cache.util.CachePrinter;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -298,4 +299,12 @@
    {
       return invocationContextContainer.get();
    }
+
+
+   public String toString()
+   {
+      return "InterceptorChain{\n" +
+            CachePrinter.printInterceptorChain(firstInChain) +
+            "\n}";
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java	2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java	2008-04-28 12:18:52 UTC (rev 5718)
@@ -15,6 +15,7 @@
 import org.jboss.cache.commands.tx.RollbackCommand;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.Start;
 import static org.jboss.cache.lock.NodeLock.LockType.READ;
 import static org.jboss.cache.lock.NodeLock.LockType.WRITE;
 import org.jboss.cache.optimistic.TransactionWorkspace;
@@ -44,6 +45,13 @@
       lockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
    }
 
+   @Start
+   private void checkTransactionManager()
+   {
+      if (txManager == null)
+         log.fatal("No transaction manager lookup class has been defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used!  Expect errors!!");
+   }
+
    @Override
    public Object handleOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
    {

Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java	2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java	2008-04-28 12:18:52 UTC (rev 5718)
@@ -66,7 +66,7 @@
          {
             sb.append(printInterceptorChain(i.getNext())).append("\n");
          }
-         sb.append(">> ");
+         sb.append("\t>> ");
          sb.append(i.getClass().getName());
       }
       return sb.toString();




More information about the jbosscache-commits mailing list