jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r647847 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: AbstractNodeData.java ItemData.java ItemImpl.java ItemManager.java NodeDataRef.java
Date Mon, 14 Apr 2008 15:31:46 GMT
Author: dpfister
Date: Mon Apr 14 08:31:28 2008
New Revision: 647847

URL: http://svn.apache.org/viewvc?rev=647847&view=rev
Log:
JCR-1104 - JSR 283 support
- shareble nodes (work in progress)
- status must not be reset in ItemImpl constructor

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AbstractNodeData.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemData.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeDataRef.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AbstractNodeData.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AbstractNodeData.java?rev=647847&r1=647846&r2=647847&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AbstractNodeData.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AbstractNodeData.java
Mon Apr 14 08:31:28 2008
@@ -43,8 +43,11 @@
 
     /**
      * Create a new instance of this class.
+     *
+     * @param id item id
      */
-    protected AbstractNodeData() {
+    protected AbstractNodeData(ItemId id) {
+        super(id);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemData.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemData.java?rev=647847&r1=647846&r2=647847&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemData.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemData.java
Mon Apr 14 08:31:28 2008
@@ -25,6 +25,9 @@
  */
 public abstract class ItemData {
 
+    /** Associated item id */
+    protected final ItemId id;
+
     /** Associated item state */
     protected ItemState state;
 
@@ -41,14 +44,20 @@
      * @param definition item definition
      */
     protected ItemData(ItemState state, ItemDefinition definition) {
+        this.id = state.getId();
         this.state = state;
         this.definition = definition;
+        this.status = ItemImpl.STATUS_NORMAL;
     }
 
     /**
      * Create a new instance of this class.
+     *
+     * @param id item id
      */
-    protected ItemData() {
+    protected ItemData(ItemId id) {
+        this.id = id;
+        this.status = ItemImpl.STATUS_NORMAL;
     }
 
     /**
@@ -121,7 +130,7 @@
      * @return item id
      */
     public ItemId getId() {
-        return getState().getId();
+        return id;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java?rev=647847&r1=647846&r2=647847&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
Mon Apr 14 08:31:28 2008
@@ -125,7 +125,6 @@
         this.id = data.getId();
         this.itemMgr = itemMgr;
         this.data = data;
-        data.setStatus(STATUS_NORMAL);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java?rev=647847&r1=647846&r2=647847&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemManager.java
Mon Apr 14 08:31:28 2008
@@ -905,12 +905,11 @@
      */
     public void stateDestroyed(ItemState destroyed) {
         ItemData data = retrieveItem(destroyed.getId());
-        if (data != null) {
-            data.setStatus(ItemImpl.STATUS_DESTROYED);
-            if (data.getState() == destroyed) {
-                data.setState(null);
-            }
+        if (data != null && data.getState() == destroyed) {
             itemDestroyed(destroyed.getId(), data);
+
+            data.setStatus(ItemImpl.STATUS_DESTROYED);
+            data.setState(null);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeDataRef.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeDataRef.java?rev=647847&r1=647846&r2=647847&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeDataRef.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeDataRef.java
Mon Apr 14 08:31:28 2008
@@ -35,6 +35,8 @@
      * @param primaryParentId primary parent id
      */
     protected NodeDataRef(AbstractNodeData data, NodeId primaryParentId) {
+        super(data.getId());
+
         this.data = data;
 
         setPrimaryParentId(primaryParentId);



Mime
View raw message