jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r156150 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
Date Fri, 04 Mar 2005 12:42:39 GMT
Author: tripod
Date: Fri Mar  4 04:42:38 2005
New Revision: 156150

URL: http://svn.apache.org/viewcvs?view=rev&rev=156150
Log:
- fixing loss of versionlabels node state after full gc

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?view=diff&r1=156149&r2=156150
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
Fri Mar  4 04:42:38 2005
@@ -198,6 +198,8 @@
                     VersionLabelsNodeState vlns = new VersionLabelsNodeState(this, (InternalVersionHistory)
vi, state.getUUID(), uuid);
                     vlns.setDefinitionId(NDEF_VERSION_LABELS);
                     state.addChildNodeEntry(JCR_VERSIONLABELS, uuid);
+                    // need to add as hard reference to version history, so that it does
not get fluhed.
+                    state.addStateReference(vlns);
                     nodes.put(new NodeId(uuid), vlns);
 
                 } else if (vi instanceof InternalVersion) {
@@ -437,19 +439,19 @@
     }
 
     /**
-     * @see ItemStateListener#stateCreated
+     * {@inheritDoc}
      */
     public void stateCreated(ItemState created) {
     }
 
     /**
-     * @see ItemStateListener#stateModified
+     * {@inheritDoc}
      */
     public void stateModified(ItemState modified) {
     }
 
     /**
-     * @see ItemStateListener#stateDestroyed
+     * {@inheritDoc}
      */
     public void stateDestroyed(ItemState destroyed) {
         destroyed.removeListener(this);
@@ -464,7 +466,7 @@
     }
 
     /**
-     * @see ItemStateListener#stateDiscarded
+     * {@inheritDoc}
      */
     public void stateDiscarded(ItemState discarded) {
         discarded.removeListener(this);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java?view=diff&r1=156149&r2=156150
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
Fri Mar  4 04:42:38 2005
@@ -44,6 +44,9 @@
      */
     private final HashMap properties = new HashMap();
 
+    /** a set of hard references to child states */
+    private HashSet stateRefs = null;
+
     /**
      * creates a new virtual node state
      *
@@ -228,6 +231,27 @@
 
         protected VirtualPropertyEntry(QName propName) {
             super(propName);
+        }
+    }
+
+    /**
+     * Adds a hard reference to another state
+     * @param state
+     */
+    public void addStateReference(NodeState state) {
+        if (stateRefs == null) {
+            stateRefs = new HashSet();
+        }
+        stateRefs.add(state);
+    }
+
+    /**
+     * Removes a hard reference to another state
+     * @param state
+     */
+    public void removeStateReferences(NodeState state) {
+        if (stateRefs != null) {
+            stateRefs.remove(state);
         }
     }
 }



Mime
View raw message