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

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jul 7 17:27:38 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-07 17:27:37 -0400 (Mon, 07 Jul 2008)
New Revision: 6200

Added:
   core/trunk/src/main/java/org/jboss/cache/InternalNode.java
Removed:
   core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java
Modified:
   core/trunk/src/main/java/org/jboss/cache/DataContainer.java
   core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
   core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
   core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
   core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java
Log:
Moved InternalNode to a more logical package

Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -1,7 +1,6 @@
 package org.jboss.cache;
 
 import org.jboss.cache.marshall.NodeData;
-import org.jboss.cache.mvcc.InternalNode;
 
 import java.util.List;
 import java.util.Set;

Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -10,7 +10,6 @@
 import org.jboss.cache.invocation.NodeInvocationDelegate;
 import org.jboss.cache.lock.LockManager;
 import org.jboss.cache.marshall.NodeData;
-import org.jboss.cache.mvcc.InternalNode;
 
 import java.util.ArrayList;
 import java.util.Collections;

Copied: core/trunk/src/main/java/org/jboss/cache/InternalNode.java (from rev 6186, core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InternalNode.java	                        (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/InternalNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -0,0 +1,132 @@
+package org.jboss.cache;
+
+import org.jboss.cache.lock.NodeLock;
+import org.jboss.cache.optimistic.DataVersion;
+import org.jboss.cache.transaction.GlobalTransaction;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * An internal node interface, that represents nodes that directly form the tree structure in the cache.  This is as opposed
+ * to {@link Node} and it's {@link NodeSPI} sub-interface, which are typically implemented by delegates which then delegate calls
+ * to internal nodes, potentially after passing the call up an interceptor chain.
+ * <p/>
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public interface InternalNode<K, V>
+{
+   NodeSPI getParent();
+
+   CacheSPI getCache();
+
+   boolean isChildrenLoaded();
+
+   void setChildrenLoaded(boolean flag);
+
+   Object getDirect(Object key);
+
+   Map getDataDirect();
+
+   Object putDirect(Object key, Object value);
+
+   NodeSPI getOrCreateChild(Object child_name, GlobalTransaction gtx, boolean notify);
+
+   Object removeDirect(Object key);
+
+   void addChildDirect(NodeSPI child);
+
+   NodeSPI addChildDirect(Fqn f);
+
+   NodeSPI addChildDirect(Fqn f, boolean notify);
+
+   NodeSPI addChildDirect(Object o, boolean notify);
+
+   void clearDataDirect();
+
+   NodeSPI getChildDirect(Fqn fqn);
+
+   Set<Object> getChildrenNamesDirect();
+
+   Set<Object> getKeysDirect();
+
+   boolean removeChildDirect(Object childName);
+
+   boolean removeChildDirect(Fqn f);
+
+   Map<Object, Node<K, V>> getChildrenMapDirect();
+
+   void setChildrenMapDirect(Map<Object, Node<K, V>> children);
+
+   void putAllDirect(Map data);
+
+   void removeChildrenDirect();
+
+   void setVersion(DataVersion version);
+
+   DataVersion getVersion();
+
+   Fqn getFqn();
+
+   void setFqn(Fqn fqn);
+
+   NodeSPI getChildDirect(Object childName);
+
+   Set<NodeSPI> getChildrenDirect();
+
+   boolean hasChildrenDirect();
+
+   Set<NodeSPI> getChildrenDirect(boolean includeMarkedForRemoval);
+
+   boolean isDataLoaded();
+
+   void setDataLoaded(boolean dataLoaded);
+
+   boolean isValid();
+
+   void setValid(boolean valid, boolean recursive);
+
+   boolean isLockForChildInsertRemove();
+
+   void setLockForChildInsertRemove(boolean lockForChildInsertRemove);
+
+   void setInternalState(Map state);
+
+   Map getInternalState(boolean onlyInternalState);
+
+   void releaseObjectReferences(boolean recursive);
+
+   boolean isDeleted();
+
+   void markAsDeleted(boolean marker);
+
+   void markAsDeleted(boolean marker, boolean recursive);
+
+   void setResident(boolean resident);
+
+   boolean isResident();
+
+   /**
+    * Creates a new instance of the same type and copies internal state.  Note that a shallow copy is made for all fields
+    * except the data map, where a new map is created.
+    *
+    * @return a copy.
+    */
+   InternalNode copy();
+
+   NodeLock getLock();
+
+   void addChild(Object nodeName, Node<K, V> nodeToAdd);
+
+   void printDetails(StringBuilder sb, int indent);
+
+   /**
+    * Very similar to getChildrenMapDirect() except that if the internal map is null, it initialises the map if init is true.
+    *
+    * @param init if true, will init internal data structures.
+    * @return a Map or null.
+    */
+   Map<Object, Node<K, V>> getChildrenMapDirect(boolean init);
+}

Modified: core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeFactory.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/NodeFactory.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -17,7 +17,6 @@
 import org.jboss.cache.invocation.NodeInvocationDelegate;
 import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.lock.LockStrategyFactory;
-import org.jboss.cache.mvcc.InternalNode;
 import org.jboss.cache.mvcc.NodeReference;
 import org.jboss.cache.mvcc.NullMarkerNode;
 import org.jboss.cache.mvcc.ReadCommittedNode;

Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -15,7 +15,6 @@
 import org.jboss.cache.lock.IdentityLock;
 import org.jboss.cache.lock.LockStrategyFactory;
 import org.jboss.cache.marshall.MarshalledValue;
-import org.jboss.cache.mvcc.InternalNode;
 import org.jboss.cache.optimistic.DataVersion;
 import org.jboss.cache.transaction.GlobalTransaction;
 

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/MVCCLockingInterceptor.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -3,6 +3,7 @@
 import org.jboss.cache.CacheException;
 import org.jboss.cache.DataContainer;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.NodeFactory;
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.commands.VisitableCommand;
@@ -33,7 +34,6 @@
 import org.jboss.cache.lock.LockManager;
 import static org.jboss.cache.lock.LockType.WRITE;
 import org.jboss.cache.lock.TimeoutException;
-import org.jboss.cache.mvcc.InternalNode;
 import org.jboss.cache.mvcc.NullMarkerNode;
 import org.jboss.cache.mvcc.ReadCommittedNode;
 

Modified: core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -3,12 +3,12 @@
 import org.jboss.cache.CacheException;
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.Node;
 import org.jboss.cache.NodeNotValidException;
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.config.Option;
 import org.jboss.cache.lock.NodeLock;
-import org.jboss.cache.mvcc.InternalNode;
 import org.jboss.cache.optimistic.DataVersion;
 import org.jboss.cache.transaction.GlobalTransaction;
 

Deleted: core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -1,133 +0,0 @@
-package org.jboss.cache.mvcc;
-
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.lock.NodeLock;
-import org.jboss.cache.optimistic.DataVersion;
-import org.jboss.cache.transaction.GlobalTransaction;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * // TODO Document this
- *
- * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
- * @since 3.0
- */
-public interface InternalNode<K, V>
-{
-   NodeSPI getParent();
-
-   CacheSPI getCache();
-
-   boolean isChildrenLoaded();
-
-   void setChildrenLoaded(boolean flag);
-
-   Object getDirect(Object key);
-
-   Map getDataDirect();
-
-   Object putDirect(Object key, Object value);
-
-   NodeSPI getOrCreateChild(Object child_name, GlobalTransaction gtx, boolean notify);
-
-   Object removeDirect(Object key);
-
-   void addChildDirect(NodeSPI child);
-
-   NodeSPI addChildDirect(Fqn f);
-
-   NodeSPI addChildDirect(Fqn f, boolean notify);
-
-   NodeSPI addChildDirect(Object o, boolean notify);
-
-   void clearDataDirect();
-
-   NodeSPI getChildDirect(Fqn fqn);
-
-   Set<Object> getChildrenNamesDirect();
-
-   Set<Object> getKeysDirect();
-
-   boolean removeChildDirect(Object childName);
-
-   boolean removeChildDirect(Fqn f);
-
-   Map<Object, Node<K, V>> getChildrenMapDirect();
-
-   void setChildrenMapDirect(Map<Object, Node<K, V>> children);
-
-   void putAllDirect(Map data);
-
-   void removeChildrenDirect();
-
-   void setVersion(DataVersion version);
-
-   DataVersion getVersion();
-
-   Fqn getFqn();
-
-   void setFqn(Fqn fqn);
-
-   NodeSPI getChildDirect(Object childName);
-
-   Set<NodeSPI> getChildrenDirect();
-
-   boolean hasChildrenDirect();
-
-   Set<NodeSPI> getChildrenDirect(boolean includeMarkedForRemoval);
-
-   boolean isDataLoaded();
-
-   void setDataLoaded(boolean dataLoaded);
-
-   boolean isValid();
-
-   void setValid(boolean valid, boolean recursive);
-
-   boolean isLockForChildInsertRemove();
-
-   void setLockForChildInsertRemove(boolean lockForChildInsertRemove);
-
-   void setInternalState(Map state);
-
-   Map getInternalState(boolean onlyInternalState);
-
-   void releaseObjectReferences(boolean recursive);
-
-   boolean isDeleted();
-
-   void markAsDeleted(boolean marker);
-
-   void markAsDeleted(boolean marker, boolean recursive);
-
-   void setResident(boolean resident);
-
-   boolean isResident();
-
-   /**
-    * Creates a new instance of the same type and copies internal state.  Note that a shallow copy is made for all fields
-    * except the data map, where a new map is created.
-    *
-    * @return a copy.
-    */
-   InternalNode copy();
-
-   NodeLock getLock();
-
-   void addChild(Object nodeName, Node<K, V> nodeToAdd);
-
-   void printDetails(StringBuilder sb, int indent);
-
-   /**
-    * Very similar to getChildrenMapDirect() except that if the internal map is null, it initialises the map if init is true.
-    *
-    * @param init if true, will init internal data structures.
-    * @return a Map or null.
-    */
-   Map<Object, Node<K, V>> getChildrenMapDirect(boolean init);
-}

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.Node;
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.lock.NodeLock;

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NullMarkerNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -1,6 +1,7 @@
 package org.jboss.cache.mvcc;
 
 import org.jboss.cache.DataContainer;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.NodeFactory;
 import org.jboss.cache.invocation.InvocationContext;
 

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/ReadCommittedNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.DataContainer;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.NodeFactory;
 import org.jboss.cache.NodeNotExistsException;
 import org.jboss.cache.NodeSPI;

Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java	2008-07-07 21:21:24 UTC (rev 6199)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/RepeatableReadNode.java	2008-07-07 21:27:37 UTC (rev 6200)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.DataContainer;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.InternalNode;
 import org.jboss.cache.NodeFactory;
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.invocation.InvocationContext;




More information about the jbosscache-commits mailing list