[hornetq-commits] JBoss hornetq SVN: r10881 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jun 27 09:38:04 EDT 2011


Author: borges
Date: 2011-06-27 09:38:04 -0400 (Mon, 27 Jun 2011)
New Revision: 10881

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/InVMNodeManager.java
Log:
Document class purpose.

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/InVMNodeManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/InVMNodeManager.java	2011-06-27 13:37:28 UTC (rev 10880)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/InVMNodeManager.java	2011-06-27 13:38:04 UTC (rev 10881)
@@ -13,25 +13,31 @@
 
 package org.hornetq.core.server.impl;
 
+import static org.hornetq.core.server.impl.InVMNodeManager.State.FAILING_BACK;
+import static org.hornetq.core.server.impl.InVMNodeManager.State.LIVE;
+import static org.hornetq.core.server.impl.InVMNodeManager.State.NOT_STARTED;
+import static org.hornetq.core.server.impl.InVMNodeManager.State.PAUSED;
+
+import java.util.concurrent.Semaphore;
+
 import org.hornetq.api.core.SimpleString;
 import org.hornetq.core.server.NodeManager;
 import org.hornetq.utils.UUIDGenerator;
 
-import java.util.concurrent.Semaphore;
-
-import static org.hornetq.core.server.impl.InVMNodeManager.State.*;
-
 /**
- * @author <a href="mailto:andy.taylor at jboss.com">Andy Taylor</a>
- *         Date: Oct 13, 2010
- *         Time: 3:55:47 PM
+ * This is a _mock_ NodeManager and is used only in tests.
+ * <p>
+ * It allows writing tests without the need to spawn a new JVM.
+ * 
+ * @author <a href="mailto:andy.taylor at jboss.com">Andy Taylor</a> Date: Oct 13, 2010 Time: 3:55:47
+ *         PM
  */
 public class InVMNodeManager extends NodeManager
 {
 
-   private Semaphore liveLock;
+   private final Semaphore liveLock;
 
-   private Semaphore backupLock;
+   private final Semaphore backupLock;
 
    public enum State {LIVE, PAUSED, FAILING_BACK, NOT_STARTED}
 
@@ -119,7 +125,7 @@
    @Override
    public boolean isAwaitingFailback() throws Exception
    {
-      return state == FAILING_BACK; 
+      return state == FAILING_BACK;
    }
 
    @Override



More information about the hornetq-commits mailing list