jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1167159 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ version/
Date Fri, 09 Sep 2011 13:31:56 GMT
Author: mduerig
Date: Fri Sep  9 13:31:55 2011
New Revision: 1167159

URL: http://svn.apache.org/viewvc?rev=1167159&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: simplify Item lifecycle management

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
Fri Sep  9 13:31:55 2011
@@ -100,8 +100,6 @@ public class ItemCacheImpl implements It
         if (log.isDebugEnabled()) {
             log.debug("destroyed item " + item);
         }
-        // we're no longer interested in this item
-        ((ItemImpl)item).removeLifeCycleListener(this);
         // remove instance from cache
         evictItem(((ItemImpl)item).getItemState());
     }
@@ -116,7 +114,9 @@ public class ItemCacheImpl implements It
      */
     private synchronized void cacheItem(ItemState state, Item item) {
         if (cache.containsKey(state)) {
-            log.warn("overwriting cached item " + state);
+            if (log.isDebugEnabled()) {
+                log.debug("overwriting cached item " + state);
+            }
         }
         if (log.isDebugEnabled()) {
             log.debug("caching item " + state);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
Fri Sep  9 13:31:55 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
@@ -30,7 +29,6 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.commons.util.Unchecked;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,8 +41,6 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import java.util.Collections;
-import java.util.Map;
 
 /**
  * {@code ItemImpl}...
@@ -60,21 +56,14 @@ public abstract class ItemImpl implement
     protected final SessionImpl session;
 
     /**
-     * Listeners (weak references)
+     * Lifecycle listener to this item
      */
-    protected final Map<ItemLifeCycleListener, ItemLifeCycleListener> listeners =
-        Collections.synchronizedMap(Unchecked.<Map<ItemLifeCycleListener, ItemLifeCycleListener>>cast(
-                new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK)));
+    private ItemLifeCycleListener listener;
 
-    protected ItemImpl(SessionImpl session, ItemState state, ItemLifeCycleListener[] listeners)
{
+    protected ItemImpl(SessionImpl session, ItemState state, ItemLifeCycleListener listener)
{
         this.session = session;
         this.state = state;
-
-        if (listeners != null) {
-            for (ItemLifeCycleListener listener : listeners) {
-                addLifeCycleListener(listener);
-            }
-        }
+        this.listener = listener;
         notifyCreated();
 
         // add this item as listener to events of the underlying state object
@@ -318,13 +307,11 @@ public abstract class ItemImpl implement
     //----------------------------------------------------------< LiveCycle >---
 
     /**
-     * Notify the listeners that this instance has been created.
+     * Notify the listener that this instance has been created.
      */
     private void notifyCreated() {
-        // copy listeners to array to avoid ConcurrentModificationException
-        ItemLifeCycleListener[] la = listeners.values().toArray(new ItemLifeCycleListener[listeners.size()]);
-        for (ItemLifeCycleListener aLa : la) {
-            aLa.itemCreated(this);
+        if (listener != null) {
+            listener.itemCreated(this);
         }
     }
 
@@ -332,12 +319,8 @@ public abstract class ItemImpl implement
      * Notify the listeners that this instance has been updated.
      */
     private void notifyUpdated(boolean modified) {
-        // copy listeners to array to avoid ConcurrentModificationException
-        ItemLifeCycleListener[] la = listeners.values().toArray(new ItemLifeCycleListener[listeners.size()]);
-        for (ItemLifeCycleListener aLa : la) {
-            if (aLa != null) {
-                aLa.itemUpdated(this, modified);
-            }
+        if (listener != null) {
+            listener.itemUpdated(this, modified);
         }
     }
 
@@ -345,35 +328,12 @@ public abstract class ItemImpl implement
      * Notify the listeners that this instance has been destroyed.
      */
     private void notifyDestroyed() {
-        // copy listeners to array to avoid ConcurrentModificationException
-        ItemLifeCycleListener[] la = listeners.values().toArray(new ItemLifeCycleListener[listeners.size()]);
-        for (ItemLifeCycleListener aLa : la) {
-            if (aLa != null) {
-                aLa.itemDestroyed(this);
-            }
-        }
-    }
-
-    /**
-     * Add an {@code ItemLifeCycleListener}
-     *
-     * @param listener the new listener to be informed on life cycle changes
-     */
-    final void addLifeCycleListener(ItemLifeCycleListener listener) {
-        if (!listeners.containsKey(listener)) {
-            listeners.put(listener, listener);
+        if (listener != null) {
+            listener.itemDestroyed(this);
+            listener = null;  // item is gone for good
         }
     }
 
-    /**
-     * Remove an {@code ItemLifeCycleListener}
-     *
-     * @param listener an existing listener
-     */
-    void removeLifeCycleListener(ItemLifeCycleListener listener) {
-        listeners.remove(listener);
-    }
-
     //------------------------------------------------------< check methods >---
 
     /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
Fri Sep  9 13:31:55 2011
@@ -134,7 +134,7 @@ public interface ItemManager {
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    boolean hasChildProperties(NodeEntry parentEntry) throws ItemNotFoundException, RepositoryException;
+    boolean hasProperties(NodeEntry parentEntry) throws ItemNotFoundException, RepositoryException;
 
     /**
      *
@@ -143,5 +143,5 @@ public interface ItemManager {
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    PropertyIterator getChildProperties(NodeEntry parentEntry) throws ItemNotFoundException,
RepositoryException;
+    PropertyIterator getProperties(NodeEntry parentEntry) throws ItemNotFoundException, RepositoryException;
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
Fri Sep  9 13:31:55 2011
@@ -231,7 +231,7 @@ public class ItemManagerImpl implements 
     }
 
     @Override
-    public synchronized boolean hasChildProperties(NodeEntry parentEntry) throws RepositoryException
{
+    public synchronized boolean hasProperties(NodeEntry parentEntry) throws RepositoryException
{
         // check sanity of session
         session.checkIsAlive();
 
@@ -251,7 +251,7 @@ public class ItemManagerImpl implements 
     }
 
     @Override
-    public synchronized PropertyIterator getChildProperties(NodeEntry parentEntry) throws
RepositoryException {
+    public synchronized PropertyIterator getProperties(NodeEntry parentEntry) throws RepositoryException
{
         // check sanity of session
         session.checkIsAlive();
 
@@ -282,19 +282,18 @@ public class ItemManagerImpl implements 
     private NodeImpl createNodeInstance(NodeState state) throws RepositoryException {
         // we want to be informed on life cycle changes of the new node object
         // in order to maintain item cache consistency
-        ItemLifeCycleListener[] listeners = new ItemLifeCycleListener[]{itemCache};
 
         // check special nodes
         Name ntName = state.getNodeTypeName();
         if (NameConstants.NT_VERSION.equals(ntName)) {
             // version
-            return new VersionImpl(session, state, listeners);
+            return new VersionImpl(session, state, itemCache);
         } else if (NameConstants.NT_VERSIONHISTORY.equals(ntName)) {
             // version-history
-            return new VersionHistoryImpl(session, state, listeners);
+            return new VersionHistoryImpl(session, state, itemCache);
         } else {
             // create common node object
-            return new NodeImpl(session, state, listeners);
+            return new NodeImpl(session, state, itemCache);
         }
     }
 
@@ -305,9 +304,9 @@ public class ItemManagerImpl implements 
     private PropertyImpl createPropertyInstance(PropertyState state) {
         // we want to be informed on life cycle changes of the new property object
         // in order to maintain item cache consistency
-        ItemLifeCycleListener[] listeners = new ItemLifeCycleListener[]{itemCache};
+
         // create property object
-        return new PropertyImpl(session, state, listeners);
+        return new PropertyImpl(session, state, itemCache);
     }
 
     //------------------------------------------< ItemStateCreationListener >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Fri Sep  9 13:31:55 2011
@@ -90,8 +90,8 @@ import java.util.List;
 public class NodeImpl extends ItemImpl implements Node {
     private static final Logger log = LoggerFactory.getLogger(NodeImpl.class);
 
-    protected NodeImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners)
{
-        super(session, state, listeners);
+    protected NodeImpl(SessionImpl session, NodeState state, ItemLifeCycleListener listener)
{
+        super(session, state, listener);
         Name nodeTypeName = state.getNodeTypeName();
         // make sure the nodetype name is valid
         if (!session.getNodeTypeManager().hasNodeType(nodeTypeName)) {
@@ -442,7 +442,7 @@ public class NodeImpl extends ItemImpl i
     public PropertyIterator getProperties() throws RepositoryException {
         checkStatus();
         try {
-            return getItemManager().getChildProperties(getNodeEntry());
+            return getItemManager().getProperties(getNodeEntry());
         } catch (ItemNotFoundException e) {
             String msg = "Failed to list the child properties of " + getPath();
             log.debug(msg);
@@ -571,7 +571,7 @@ public class NodeImpl extends ItemImpl i
     @Override
     public boolean hasProperties() throws RepositoryException {
         checkStatus();
-        return getItemManager().hasChildProperties(getNodeEntry());
+        return getItemManager().hasProperties(getNodeEntry());
     }
 
     @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Fri Sep  9 13:31:55 2011
@@ -16,9 +16,19 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.Calendar;
+import org.apache.jackrabbit.jcr2spi.operation.Operation;
+import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
+import org.apache.jackrabbit.jcr2spi.state.PropertyState;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.QPropertyDefinition;
+import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.apache.jackrabbit.spi.commons.value.ValueFormat;
+import org.apache.jackrabbit.value.ValueHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.Binary;
 import javax.jcr.Item;
@@ -31,24 +41,11 @@ import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
-import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.version.VersionException;
-
-import org.apache.jackrabbit.jcr2spi.operation.Operation;
-import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
-import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.QPropertyDefinition;
-import org.apache.jackrabbit.spi.QValue;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.spi.commons.value.ValueFormat;
-import org.apache.jackrabbit.value.ValueHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.Calendar;
 
 /**
  * {@code PropertyImpl}...
@@ -56,8 +53,8 @@ import org.slf4j.LoggerFactory;
 public class PropertyImpl extends ItemImpl implements Property {
     private static final Logger log = LoggerFactory.getLogger(PropertyImpl.class);
 
-    public PropertyImpl(SessionImpl session, PropertyState state, ItemLifeCycleListener[]
listeners) {
-        super(session, state, listeners);
+    public PropertyImpl(SessionImpl session, PropertyState state, ItemLifeCycleListener listener)
{
+        super(session, state, listener);
         // NOTE: JCR value(s) will be read (and converted from the internal value representation)
on demand.
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Fri Sep  9 13:31:55 2011
@@ -269,7 +269,7 @@ public class SessionImpl extends Abstrac
         checkIsAlive();
         try {
             NodeEntry nodeEntry = getHierarchyManager().getNodeEntry(id);
-            Item item = getItemManager().getItem(nodeEntry);
+            Item item = itemManager.getItem(nodeEntry);
             if (item.isNode()) {
                 return (Node) item;
             } else {
@@ -289,11 +289,10 @@ public class SessionImpl extends Abstrac
         checkIsAlive();
         try {
             Path qPath = getQPath(absPath).getNormalizedPath();
-            ItemManager itemMgr = getItemManager();
-            if (itemMgr.nodeExists(qPath)) {
-                return itemMgr.getNode(qPath);
+            if (itemManager.nodeExists(qPath)) {
+                return itemManager.getNode(qPath);
             } else {
-                return itemMgr.getProperty(qPath);
+                return itemManager.getProperty(qPath);
             }
         } catch (AccessDeniedException ade) {
             throw new PathNotFoundException(absPath);
@@ -307,8 +306,7 @@ public class SessionImpl extends Abstrac
     public boolean itemExists(String absPath) throws RepositoryException {
         checkIsAlive();
         Path qPath = getQPath(absPath).getNormalizedPath();
-        ItemManager itemMgr = getItemManager();
-        return itemMgr.nodeExists(qPath) || itemMgr.propertyExists(qPath);
+        return itemManager.nodeExists(qPath) || itemManager.propertyExists(qPath);
     }
 
     /**
@@ -524,8 +522,7 @@ public class SessionImpl extends Abstrac
         checkIsAlive();
         try {
             Path qPath = getQPath(absPath).getNormalizedPath();
-            ItemManager itemMgr = getItemManager();
-            return itemMgr.getNode(qPath);
+            return itemManager.getNode(qPath);
         } catch (AccessDeniedException ade) {
             throw new PathNotFoundException(absPath);
         }
@@ -547,8 +544,7 @@ public class SessionImpl extends Abstrac
         checkIsAlive();
         try {
             Path qPath = getQPath(absPath).getNormalizedPath();
-            ItemManager itemMgr = getItemManager();
-            return itemMgr.getProperty(qPath);
+            return itemManager.getProperty(qPath);
         } catch (AccessDeniedException ade) {
             throw new PathNotFoundException(absPath);
         }
@@ -614,8 +610,7 @@ public class SessionImpl extends Abstrac
     public boolean nodeExists(String absPath) throws RepositoryException {
         checkIsAlive();
         Path qPath = getQPath(absPath).getNormalizedPath();
-        ItemManager itemMgr = getItemManager();
-        return itemMgr.nodeExists(qPath);
+        return itemManager.nodeExists(qPath);
     }
 
     /**
@@ -625,8 +620,7 @@ public class SessionImpl extends Abstrac
     public boolean propertyExists(String absPath) throws RepositoryException {
         checkIsAlive();
         Path qPath = getQPath(absPath).getNormalizedPath();
-        ItemManager itemMgr = getItemManager();
-        return itemMgr.propertyExists(qPath);
+        return itemManager.propertyExists(qPath);
     }
 
     /**
@@ -779,7 +773,7 @@ public class SessionImpl extends Abstrac
 
     //--------------------------------------------------------------------------
 
-    ItemManager getItemManager() {
+    final ItemManager getItemManager() {
         return itemManager;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
Fri Sep  9 13:31:55 2011
@@ -16,26 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.version;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jcr.AccessDeniedException;
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.Property;
-import javax.jcr.ReferentialIntegrityException;
-import javax.jcr.RepositoryException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.version.Version;
-import javax.jcr.version.VersionException;
-import javax.jcr.version.VersionHistory;
-import javax.jcr.version.VersionIterator;
-
 import org.apache.jackrabbit.commons.iterator.FrozenNodeIteratorAdapter;
-import org.apache.jackrabbit.commons.iterator.RangeIteratorAdapter;
 import org.apache.jackrabbit.commons.iterator.VersionIteratorAdapter;
 import org.apache.jackrabbit.jcr2spi.ItemLifeCycleListener;
 import org.apache.jackrabbit.jcr2spi.LazyItemIterator;
@@ -51,6 +32,21 @@ import org.apache.jackrabbit.spi.commons
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.version.Version;
+import javax.jcr.version.VersionException;
+import javax.jcr.version.VersionHistory;
+import javax.jcr.version.VersionIterator;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 /**
  * {@code VersionHistoryImpl}...
  */
@@ -60,10 +56,10 @@ public class VersionHistoryImpl extends 
     private final NodeEntry vhEntry;
     private final NodeEntry labelNodeEntry;
 
-    public VersionHistoryImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[]
listeners)
+    public VersionHistoryImpl(SessionImpl session, NodeState state, ItemLifeCycleListener
listener)
             throws RepositoryException {
 
-        super(session, state, listeners);
+        super(session, state, listener);
         vhEntry = (NodeEntry) state.getHierarchyEntry();
 
         // retrieve hierarchy entry of the jcr:versionLabels node

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java?rev=1167159&r1=1167158&r2=1167159&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
Fri Sep  9 13:31:55 2011
@@ -16,7 +16,14 @@
  */
 package org.apache.jackrabbit.jcr2spi.version;
 
-import java.util.Calendar;
+import org.apache.jackrabbit.jcr2spi.ItemLifeCycleListener;
+import org.apache.jackrabbit.jcr2spi.NodeImpl;
+import org.apache.jackrabbit.jcr2spi.SessionImpl;
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.Item;
 import javax.jcr.Node;
@@ -27,15 +34,7 @@ import javax.jcr.nodetype.ConstraintViol
 import javax.jcr.version.Version;
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
-
-import org.apache.jackrabbit.jcr2spi.ItemLifeCycleListener;
-import org.apache.jackrabbit.jcr2spi.NodeImpl;
-import org.apache.jackrabbit.jcr2spi.SessionImpl;
-import org.apache.jackrabbit.jcr2spi.state.NodeState;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.Calendar;
 
 /**
  * {@code VersionImpl}...
@@ -43,9 +42,8 @@ import org.slf4j.LoggerFactory;
 public class VersionImpl extends NodeImpl implements Version {
     private static final Logger log = LoggerFactory.getLogger(VersionImpl.class);
 
-    public VersionImpl(SessionImpl session, NodeState state,
-                       ItemLifeCycleListener[] listeners) {
-        super(session, state, listeners);
+    public VersionImpl(SessionImpl session, NodeState state, ItemLifeCycleListener listener)
{
+        super(session, state, listener);
     }
 
     //------------------------------------------------------------< Version >---



Mime
View raw message