jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r470291 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ lock/ observation/ state/ version/
Date Thu, 02 Nov 2006 09:38:22 GMT
Author: angela
Date: Thu Nov  2 01:38:20 2006
New Revision: 470291

URL: http://svn.apache.org/viewvc?view=rev&rev=470291
Log:
work in progress

- javadoc
- minor naming improvement
- comments

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/InternalEventListener.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManager.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManager.java
Thu Nov  2 01:38:20 2006
@@ -37,18 +37,17 @@
      * @throws PathNotFoundException
      * @throws RepositoryException
      */
-    ItemState getItemState(Path qPath) throws PathNotFoundException, RepositoryException;
+    public ItemState getItemState(Path qPath) throws PathNotFoundException, RepositoryException;
 
     /**
-     * Returns the depth of the specified item which is equivalent to
-     * <code>getQPath(id).getAncestorCount()</code>. The depth reflects the
+     * Returns the depth of the specified item. The depth reflects the
      * absolute hierarchy level.
      *
      * @param itemState item state
      * @return the depth of the specified item
      * @throws RepositoryException if another error occurs
      */
-    int getDepth(ItemState itemState) throws ItemNotFoundException, RepositoryException;
+    public int getDepth(ItemState itemState) throws ItemNotFoundException, RepositoryException;
 
     /**
      * Returns the depth of the specified descendant relative to the given
@@ -65,6 +64,5 @@
      * denote an existing item.
      * @throws RepositoryException If another error occurs.
      */
-    int getRelativeDepth(NodeState ancestor, ItemState descendant)
-            throws ItemNotFoundException, RepositoryException;
+    public int getRelativeDepth(NodeState ancestor, ItemState descendant) throws ItemNotFoundException,
RepositoryException;
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManagerImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/HierarchyManagerImpl.java
Thu Nov  2 01:38:20 2006
@@ -33,15 +33,16 @@
 import javax.jcr.RepositoryException;
 
 /**
- * <code>HierarchyManagerImpl</code> ...
+ * <code>HierarchyManagerImpl</code> implements the <code>HierarchyManager</code>
+ * interface.
  */
 public class HierarchyManagerImpl implements HierarchyManager {
 
     private static Logger log = LoggerFactory.getLogger(HierarchyManagerImpl.class);
 
-    protected final ItemStateManager itemStateManager;
+    private final ItemStateManager itemStateManager;
     // used for outputting user-friendly paths and names
-    protected final NamespaceResolver nsResolver;
+    private final NamespaceResolver nsResolver;
 
     public HierarchyManagerImpl(ItemStateManager itemStateManager,
                                 NamespaceResolver nsResolver) {
@@ -50,7 +51,6 @@
     }
 
     //------------------------------------------------------------< private >---
-
     /**
      * Resolve a path into an item state. Recursively invoked method that may be
      * overridden by some subclass to either return cached responses or add

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
Thu Nov  2 01:38:20 2006
@@ -29,7 +29,26 @@
 import javax.jcr.Item;
 
 /**
- * <code>ItemManager</code>...
+ * There's one <code>ItemManager</code> instance per <code>Session</code>
+ * instance. It is the factory for <code>Node</code> and <code>Property</code>
+ * instances.
+ * <p/>
+ * The <code>ItemManager</code>'s responsabilities are:
+ * <ul>
+ * <li>providing access to <code>Item</code> instances by <code>ItemState</code>
+ * whereas <code>Node</code> and <code>Item</code> are only providing
relative access.
+ * <li>returning the instance of an existing <code>Node</code> or <code>Property</code>,
+ * given its absolute path.
+ * <li>creating the per-session instance of a <code>Node</code>
+ * or <code>Property</code> that doesn't exist yet and needs to be created first.
+ * <li>guaranteeing that there aren't multiple instances representing the same
+ * <code>Node</code> or <code>Property</code> associated with the
same
+ * <code>Session</code> instance.
+ * <li>maintaining a cache of the item instances it created.
+ * </ul>
+ * <p/>
+ * If the parent <code>Session</code> is an <code>XASession</code>,
there is
+ * one <code>ItemManager</code> instance per started global transaction.
  */
 public interface ItemManager extends ItemLifeCycleListener {
 
@@ -56,8 +75,9 @@
 
 
     /**
+     *
      * @param path
-     * @return
+     * @return The item for the given path.
      * @throws javax.jcr.PathNotFoundException
      * @throws javax.jcr.AccessDeniedException
      * @throws javax.jcr.RepositoryException

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
Thu Nov  2 01:38:20 2006
@@ -51,27 +51,7 @@
 import java.util.List;
 
 /**
- * There's one <code>ItemManagerImpl</code> instance per <code>Session</code>
- * instance. It is the factory for <code>Node</code> and <code>Property</code>
- * instances.
- * <p/>
- * The <code>ItemManagerImpl</code>'s responsabilities are:
- * <ul>
- * <li>providing access to <code>Item</code> instances by <code>ItemState</code>
- * whereas <code>Node</code> and <code>Item</code> are only providing
relative access.
- * <li>returning the instance of an existing <code>Node</code> or <code>Property</code>,
- * given its absolute path.
- * <li>creating the per-session instance of a <code>Node</code>
- * or <code>Property</code> that doesn't exist yet and needs to be created first.
- * <li>guaranteeing that there aren't multiple instances representing the same
- * <code>Node</code> or <code>Property</code> associated with the
same
- * <code>Session</code> instance.
- * <li>maintaining a cache of the item instances it created.
- * <li>respecting access rights of associated <code>Session</code> in all
methods.
- * </ul>
- * <p/>
- * If the parent <code>Session</code> is an <code>XASession</code>,
there is
- * one <code>ItemManagerImpl</code> instance per started global transaction.
+ * <code>ItemManagerImpl</code> implements the <code>ItemManager</code>
interface.
  */
 public class ItemManagerImpl implements Dumpable, ItemManager {
 
@@ -139,8 +119,6 @@
         try {
             // check sanity of session
             session.checkIsAlive();
-            // check privileges
-            checkAccess(itemState, true);
 
             // always return true if access rights are granted, existence
             // of the state has been asserted before
@@ -175,8 +153,6 @@
         Item item = retrieveItem(itemState);
         // not yet in cache, need to create instance
         if (item == null) {
-            // check privileges
-            checkAccess(itemState, false);
             // create instance of item
             if (itemState.isNode()) {
                 item = createNodeInstance((NodeState) itemState);
@@ -195,7 +171,6 @@
         // check sanity of session
         session.checkIsAlive();
         parentState.checkIsSessionState();
-        checkAccess(parentState, true);
 
         Iterator iter = parentState.getChildNodeEntries().iterator();
         while (iter.hasNext()) {
@@ -221,7 +196,6 @@
         // check sanity of session
         session.checkIsAlive();
         parentState.checkIsSessionState();
-        checkAccess(parentState, true);
 
         Collection nodeEntries = parentState.getChildNodeEntries();
         List childStates = new ArrayList(nodeEntries.size());
@@ -244,7 +218,6 @@
         // check sanity of session
         session.checkIsAlive();
         parentState.checkIsSessionState();
-        checkAccess(parentState, true);
 
         Iterator iter = parentState.getPropertyEntries().iterator();
         while (iter.hasNext()) {
@@ -270,7 +243,6 @@
         // check sanity of session
         session.checkIsAlive();
         parentState.checkIsSessionState();
-        checkAccess(parentState, true);
 
         Collection propEntries = parentState.getPropertyEntries();
         List childStates = new ArrayList(propEntries.size());
@@ -364,29 +336,8 @@
 
     //----------------------------------------------------< private methods >---
     /**
-     *
      * @param state
-     * @param removeFromCache
-     * @throws RepositoryException
-     */
-    private void checkAccess(ItemState state, boolean removeFromCache) throws RepositoryException
{
-        // check privileges
-        if (!session.getAccessManager().canRead(state)) {
-            if (removeFromCache) {
-                // clear cache
-                Item item = retrieveItem(state);
-                if (item != null) {
-                    evictItem(state);
-                }
-            }
-            throw new AccessDeniedException("Cannot read item: " + state);
-        }
-    }
-
-    /**
-     *
-     * @param state
-     * @return
+     * @return a new <code>Node</code> instance.
      * @throws RepositoryException
      */
     private NodeImpl createNodeInstance(NodeState state) throws RepositoryException {
@@ -413,13 +364,10 @@
     }
 
     /**
-     * 
      * @param state
-     * @return
-     * @throws RepositoryException
+     * @return a new <code>Property</code> instance.
      */
-    private PropertyImpl createPropertyInstance(PropertyState state)
-            throws RepositoryException {
+    private PropertyImpl createPropertyInstance(PropertyState state) {
         // 1. get definition for the specified property
         QPropertyDefinition qpd = state.getDefinition();
         PropertyDefinition def = session.getNodeTypeManager().getPropertyDefinition(qpd);

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
Thu Nov  2 01:38:20 2006
@@ -27,12 +27,14 @@
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.ItemNotFoundException;
+import javax.jcr.RangeIterator;
 import javax.jcr.version.VersionIterator;
 import javax.jcr.version.Version;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Collection;
 import java.util.ArrayList;
+import java.util.Iterator;
 
 /**
  * <code>LazyItemIterator</code> is an id-based iterator that instantiates
@@ -104,17 +106,19 @@
         }
     }
 
-    //---------------------------------------------------------< NodeIterator >
+    //-------------------------------------------------------< NodeIterator >---
     /**
      * {@inheritDoc}
+     * @see NodeIterator#nextNode()
      */
     public Node nextNode() {
         return (Node) next();
     }
 
-    //-----------------------------------------------------< PropertyIterator >
+    //---------------------------------------------------< PropertyIterator >---
     /**
      * {@inheritDoc}
+     * @see PropertyIterator#nextProperty()
      */
     public Property nextProperty() {
         return (Property) next();
@@ -123,23 +127,26 @@
     //----------------------------------------------------< VersionIterator >---
     /**
      * {@inheritDoc}
+     * @see VersionIterator#nextVersion()
      */
     public Version nextVersion() {
         return (Version) next();
     }
 
-    //--------------------------------------------------------< RangeIterator >
+    //------------------------------------------------------< RangeIterator >---
     /**
      * {@inheritDoc}
+     * @see javax.jcr.RangeIterator#getPosition()
      */
     public long getPosition() {
         return pos;
     }
 
     /**
-     * {@inheritDoc}
-     * <p/>
-     * Always returns -1
+     * Always returns -1.
+     *
+     * @return always returns -1.
+     * @see RangeIterator#getSize()
      */
     public long getSize() {
         // Always returns -1, since the original list may contains items that
@@ -150,6 +157,7 @@
 
     /**
      * {@inheritDoc}
+     * @see RangeIterator#skip(long)
      */
     public void skip(long skipNum) {
         if (skipNum < 0) {
@@ -191,9 +199,10 @@
         prefetchNext();
     }
 
-    //-------------------------------------------------------------< Iterator >
+    //-----------------------------------------------------------< Iterator >---
     /**
      * {@inheritDoc}
+     * @see java.util.Iterator#hasNext()
      */
     public boolean hasNext() {
         return next != null;
@@ -201,6 +210,7 @@
 
     /**
      * {@inheritDoc}
+     * @see Iterator#next()
      */
     public Object next() {
         if (next == null) {
@@ -214,8 +224,9 @@
 
     /**
      * {@inheritDoc}
+     * @see Iterator#remove()
      *
-     * @throws UnsupportedOperationException always since not implemented
+     * @throws UnsupportedOperationException always since removal is not implemented.
      */
     public void remove() {
         throw new UnsupportedOperationException("remove");

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Thu Nov  2 01:38:20 2006
@@ -1261,8 +1261,7 @@
     }
 
     /**
-     *
-     * @return
+     * @return true if this <code>Node</code> is modified or new.
      */
     private boolean hasPendingChanges() {
         return isModified() || isNew();
@@ -1271,9 +1270,8 @@
     /**
      * Checks if this node is lockable, i.e. has 'mix:lockable'.
      *
-     * @throws UnsupportedRepositoryOperationException
-     *                             if this node is not lockable
-     * @throws RepositoryException if another error occurs
+     * @throws UnsupportedRepositoryOperationException if this node is not lockable.
+     * @throws RepositoryException if another error occurs.
      */
     private void checkIsLockable() throws UnsupportedRepositoryOperationException, RepositoryException
{
         checkSupportedOption(Repository.OPTION_LOCKING_SUPPORTED);
@@ -1288,8 +1286,8 @@
     /**
      * Check whether this node is locked by somebody else.
      *
-     * @throws LockException       if this node is locked by somebody else
-     * @throws RepositoryException if some other error occurs
+     * @throws LockException if this node is locked by somebody else.
+     * @throws RepositoryException if some other error occurs.
      */
     void checkIsLocked() throws LockException, RepositoryException {
         if (!isSupportedOption(Repository.OPTION_LOCKING_SUPPORTED) || isNew()) {
@@ -1302,6 +1300,7 @@
     }
 
     /**
+     * Check if this node is versionable.
      *
      * @throws UnsupportedRepositoryOperationException
      * @throws RepositoryException
@@ -1533,15 +1532,6 @@
      */
     private NodeState getNodeState() {
         return (NodeState) getItemState();
-    }
-
-    /**
-     * Return the id of this <code>Node</code>.
-     *
-     * @return the id of this <code>Node</code>
-     */
-    private NodeId getNodeId() {
-        return getNodeState().getNodeId();
     }
 
     /**

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Thu Nov  2 01:38:20 2006
@@ -61,7 +61,7 @@
                         ItemLifeCycleListener[] listeners) {
         super(itemManager, session, state, listeners);
         this.definition = definition;
-        // value will be read on demand
+        // value will be read (and converted from qualified value) on demand.
     }
 
     //-----------------------------------------------------< Item interface >---

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Thu Nov  2 01:38:20 2006
@@ -93,7 +93,6 @@
 import java.io.OutputStream;
 import java.security.AccessControlException;
 import java.util.Map;
-import java.util.HashMap;
 
 /**
  * <code>SessionImpl</code>...
@@ -105,10 +104,6 @@
     private boolean alive;
 
     /**
-     * the attributes of this session
-     */
-    private final HashMap attributes = new HashMap();
-    /**
      * Listeners (weak references)
      */
     private final Map listeners = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
@@ -166,17 +161,21 @@
     }
 
     /**
+     * Always returns <code>null</code>.
+     *
      * @see javax.jcr.Session#getAttribute(String)
      */
     public Object getAttribute(String name) {
-        return attributes.get(name);
+        return null;
     }
 
     /**
+     * Always returns an empty String array.
+     * 
      * @see javax.jcr.Session#getAttributeNames()
      */
     public String[] getAttributeNames() {
-        return (String[]) attributes.keySet().toArray(new String[attributes.size()]);
+        return new String[0];
 
     }
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
Thu Nov  2 01:38:20 2006
@@ -439,7 +439,7 @@
     /**
      * Validator for the <code>Workspace</code>. It contrast from {@link SessionImpl#getValidator()}
      * in terms of <code>HierarchyManager</code> and <code>ItemManager</code>.
-     * @return
+     * @return validator
      */
     private ItemStateValidator getValidator() {
         if (validator == null) {
@@ -447,6 +447,7 @@
         }
         return validator;
     }
+    
     //-----------------------------------------------------< initialization >---
     /**
      * Create the workspace state manager. May be overridden by subclasses.
@@ -459,10 +460,11 @@
     }
 
     /**
+     * Create the <code>LockManager</code>. May be overridden by subclasses.
      *
      * @param wspManager
      * @param itemManager
-     * @return
+     * @return a new <code>LockManager</code> instance.
      */
     protected LockManager createLockManager(WorkspaceManager wspManager, ItemManager itemManager)
{
         if (session.isSupportedOption(Repository.OPTION_LOCKING_SUPPORTED)) {
@@ -475,9 +477,10 @@
     }
 
     /**
+     * Create the <code>VersionManager</code>. May be overridden by subclasses.
      *
      * @param wspManager
-     * @return
+     * @return a new <code>VersionManager</code> instance.
      */
     protected VersionManager createVersionManager(WorkspaceManager wspManager) {
         if (session.isSupportedOption(Repository.OPTION_VERSIONING_SUPPORTED)) {
@@ -488,8 +491,9 @@
     }
 
     /**
+     * Create the <code>ObservationManager</code>. May be overridden by subclasses.
      *
-     * @return
+     * @return a new <code>ObservationManager</code> instance
      */
     protected ObservationManager createObservationManager(NamespaceResolver nsResolver, NodeTypeRegistry
ntRegistry) {
         ObservationManagerImpl obsMgr = new ObservationManagerImpl(nsResolver, ntRegistry);

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
Thu Nov  2 01:38:20 2006
@@ -532,7 +532,7 @@
         }
 
         //------------------------------------------< InternalEventListener >---
-        public void onEvent(EventBundle events) {
+        public void onEvent(EventBundle eventBundle) {
             if (!isLive) {
                 // since we only monitor the removal of the lock (by means
                 // of deletion of the jcr:lockIsDeep property, we are not interested
@@ -540,7 +540,7 @@
                 return;
             }
 
-            for (EventIterator it = events.getEvents(); it.hasNext(); ) {
+            for (EventIterator it = eventBundle.getEvents(); it.hasNext(); ) {
                 Event ev = it.nextEvent();
                 // if the jcr:lockIsDeep property related to this Lock got removed,
                 // we assume that the lock has been released.
@@ -558,7 +558,7 @@
             }
         }
 
-        public void onEvent(EventBundle events, ChangeLog changeLog) {
+        public void onEvent(EventBundle eventBundle, ChangeLog changeLog) {
             // nothing to do. not interested in transient modifications
         }
     }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/InternalEventListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/InternalEventListener.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/InternalEventListener.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/InternalEventListener.java
Thu Nov  2 01:38:20 2006
@@ -28,9 +28,9 @@
     /**
      * Gets called when an event occurs.
      *
-     * @param events the event set received.
+     * @param eventBundle the event set received.
      */
-    public void onEvent(EventBundle events);
+    public void onEvent(EventBundle eventBundle);
 
-    public void onEvent(EventBundle events, ChangeLog changeLog);
+    public void onEvent(EventBundle eventBundle, ChangeLog changeLog);
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
Thu Nov  2 01:38:20 2006
@@ -149,7 +149,7 @@
 
     //-----------------------< InternalEventListener >--------------------------
 
-    public void onEvent(EventBundle events) {
+    public void onEvent(EventBundle eventBundle) {
         // get active listeners
         Map activeListeners;
         synchronized (subscriptions) {
@@ -159,7 +159,7 @@
         for (Iterator it = activeListeners.keySet().iterator(); it.hasNext(); ) {
             EventListener listener = (EventListener) it.next();
             EventFilter filter = (EventFilter) activeListeners.get(listener);
-            FilteredEventIterator eventIter = new FilteredEventIterator(events, filter);
+            FilteredEventIterator eventIter = new FilteredEventIterator(eventBundle, filter);
             if (eventIter.hasNext()) {
                 try {
                     listener.onEvent(eventIter);
@@ -176,11 +176,11 @@
      * Same as {@link #onEvent(EventBundle)} but only used for local changes
      * with a <code>ChangeLog</code>.
      * 
-     * @param events
+     * @param eventBundle
      * @param changeLog
      */
-    public void onEvent(EventBundle events, ChangeLog changeLog) {
-        onEvent(events);
+    public void onEvent(EventBundle eventBundle, ChangeLog changeLog) {
+        onEvent(eventBundle);
     }
 
     //-------------------------< internal >-------------------------------------

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateManager.java
Thu Nov  2 01:38:20 2006
@@ -17,10 +17,10 @@
 package org.apache.jackrabbit.jcr2spi.state;
 
 import org.apache.jackrabbit.jcr2spi.observation.InternalEventListener;
-import org.apache.jackrabbit.spi.EventIterator;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.Event;
 import org.apache.jackrabbit.spi.EventBundle;
+import org.apache.jackrabbit.spi.EventIterator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,22 +51,22 @@
      * since workspace operations are reported as local changes as well and
      * might have invoked changes (autocreated items etc.).
      *
-     * @param events
+     * @param eventBundle
      */
-    public void onEvent(EventBundle events) {
-        pushEvents(getEventCollection(events.getEvents()));
+    public void onEvent(EventBundle eventBundle) {
+        pushEvents(getEventCollection(eventBundle));
     }
 
     /**
      *
-     * @param events
+     * @param eventBundle
      * @param changeLog
      */
-    public void onEvent(EventBundle events, ChangeLog changeLog) {
+    public void onEvent(EventBundle eventBundle, ChangeLog changeLog) {
         if (changeLog == null) {
             throw new IllegalArgumentException("ChangeLog must not be null.");
         }
-        Collection evs = getEventCollection(events.getEvents());
+        Collection evs = getEventCollection(eventBundle);
         // TODO: make sure, that events only contain events related to the modifications
submitted with the changelog.
 
         // inform the changelog target state about the transient modifications
@@ -163,10 +163,10 @@
         }
     }
 
-    private static Collection getEventCollection(EventIterator events) {
+    private static Collection getEventCollection(EventBundle eventBundle) {
         List evs = new ArrayList();
-        while (events.hasNext()) {
-           evs.add(events.nextEvent());
+        for (EventIterator it = eventBundle.getEvents(); it.hasNext();) {
+           evs.add(it.nextEvent());
         }
         return evs;
     }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java?view=diff&rev=470291&r1=470290&r2=470291
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
Thu Nov  2 01:38:20 2006
@@ -159,9 +159,9 @@
         // TODO find better solution to build the mergeFailed-collection
         final List failedIds = new ArrayList();
         InternalEventListener mergeFailedCollector = new InternalEventListener() {
-            public void onEvent(EventBundle events) {
-                if (events.isLocal()) {
-                    EventIterator it = events.getEvents();
+            public void onEvent(EventBundle eventBundle) {
+                if (eventBundle.isLocal()) {
+                    EventIterator it = eventBundle.getEvents();
                     while (it.hasNext()) {
                         Event ev = it.nextEvent();
                         if (ev.getType() == Event.PROPERTY_ADDED && QName.JCR_MERGEFAILED.equals(ev.getQPath().getNameElement().getName()))
{
@@ -170,7 +170,7 @@
                     }
                 }
             }
-            public void onEvent(EventBundle events, ChangeLog changeLog) {
+            public void onEvent(EventBundle eventBundle, ChangeLog changeLog) {
                 // nothing to do. we are not interested in transient modifications
             }
         };



Mime
View raw message