jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1173784 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/
Date Wed, 21 Sep 2011 18:31:44 GMT
Author: mduerig
Date: Wed Sep 21 18:31:43 2011
New Revision: 1173784

URL: http://svn.apache.org/viewvc?rev=1173784&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
improve error logging

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypeStore.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypes.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/ItemInfos.java
Wed Sep 21 18:31:43 2011
@@ -34,6 +34,8 @@ import org.apache.jackrabbit.spi.commons
 import org.apache.jackrabbit.spi.commons.util.Function1;
 import org.json.simple.parser.JSONParser;
 import org.json.simple.parser.ParseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.PathNotFoundException;
 import javax.jcr.PropertyType;
@@ -43,15 +45,17 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import static org.apache.jackrabbit.spi.commons.util.Iterators.iteratorChain;
-import static org.apache.jackrabbit.spi.commons.util.Iterators.singleton;
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_MIXINTYPES;
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_PRIMARYTYPE;
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_UUID;
 import static org.apache.jackrabbit.spi.commons.util.Exceptions.setCause;
+import static org.apache.jackrabbit.spi.commons.util.Iterators.iteratorChain;
+import static org.apache.jackrabbit.spi.commons.util.Iterators.singleton;
 import static org.json.simple.parser.ParseException.ERROR_UNEXPECTED_EXCEPTION;
 
 public final class ItemInfos {
+    private static final Logger log = LoggerFactory.getLogger(ItemInfos.class);
+
     private ItemInfos() {}
 
     public static Iterator<? extends ItemInfo> buildItemInfos(Path rootPath, final
Path targetPath,
@@ -107,7 +111,9 @@ public final class ItemInfos {
                 throw (RepositoryException) e.getCause();
             }
             else {
-                throw new RepositoryException(json + ' ' + e.getMessage(), e);
+                RepositoryException e0 = new RepositoryException(json + ' ' + e.getMessage(),
e);
+                log.error(e0.getMessage(), e0);
+                throw e0;
             }
         }
     }
@@ -168,6 +174,7 @@ public final class ItemInfos {
                 return !infoListener.done();
             }
             catch (RepositoryException e) {
+                log.error(e.getMessage(), e);
                 throw setCause(new ParseException(ERROR_UNEXPECTED_EXCEPTION), e);
             }
         }
@@ -218,6 +225,7 @@ public final class ItemInfos {
                 }
             }
             catch (RepositoryException e) {
+                log.error(e.getMessage(), e);
                 throw setCause(new ParseException(ERROR_UNEXPECTED_EXCEPTION), e);
             }
         }
@@ -245,6 +253,7 @@ public final class ItemInfos {
                 return !infoListener.done();
             }
             catch (RepositoryException e) {
+                log.error(e.getMessage(), e);
                 throw setCause(new ParseException(ERROR_UNEXPECTED_EXCEPTION), e);
             }
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypeStore.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypeStore.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypeStore.java
Wed Sep 21 18:31:43 2011
@@ -65,7 +65,8 @@ public class NodeTypeStore {
                 writeNodeTypes(microKernel, cnd, systemWorkspace);
             }
             catch (IOException e) {
-                throw new RepositoryException(e); 
+                log.error(e.getMessage(), e);
+                throw new RepositoryException(e);
             }
         }
 
@@ -87,6 +88,7 @@ public class NodeTypeStore {
             nodeTypeDefinitions.registerNodeTypes(ntDefinitions.toArray(new QNodeTypeDefinition[ntDefinitions.size()]),
true);
         }
         catch (ParseException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException("Error reading node type definitions", e);
         }
     }
@@ -111,6 +113,7 @@ public class NodeTypeStore {
             writeNodeTypes(microKernel, cnd, systemWorkspace);
         }
         catch (IOException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException("Error persisting node type definitions", e);
         }
     }
@@ -133,6 +136,7 @@ public class NodeTypeStore {
             microKernel.commit('/' + systemWorkspace, jsop.toString(), rev, "register default
node types");
         }
         catch (IOException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException("Error persisting node type definitions", e);
         }
     }
@@ -154,7 +158,7 @@ public class NodeTypeStore {
                 }
             }
             catch (org.json.simple.parser.ParseException e) {
-                log.error("Error parsing Json string: " + ntDefinitions, e);
+                log.error(e.getMessage(), e);
             }
 
         }
@@ -165,7 +169,9 @@ public class NodeTypeStore {
     private static InputStream getDefaultNodeTypes() throws RepositoryException {
         InputStream is = RepositoryServiceImpl.class.getResourceAsStream(DEFAULT_NODETYPES);
         if (is == null) {
-            throw new RepositoryException("Resource not found: " + DEFAULT_NODETYPES);
+            RepositoryException e = new RepositoryException("Resource not found: " + DEFAULT_NODETYPES);
+            log.error(e.getMessage(), e);
+            throw e;
         }
 
         return is;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypes.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypes.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypes.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/NodeTypes.java
Wed Sep 21 18:31:43 2011
@@ -2,9 +2,11 @@ package org.apache.jackrabbit.spi2microk
 
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
-import org.apache.jackrabbit.spi.commons.util.Iterators;
 import org.apache.jackrabbit.spi.commons.nodetype.NodeTypeStorage;
+import org.apache.jackrabbit.spi.commons.util.Iterators;
 import org.apache.jackrabbit.spi.commons.util.Predicate1;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
 import java.util.Iterator;
@@ -13,6 +15,8 @@ import static org.apache.jackrabbit.spi.
 import static org.apache.jackrabbit.spi.commons.util.Predicates.exists;
 
 public final class NodeTypes {
+    private static final Logger log = LoggerFactory.getLogger(NodeTypes.class);
+
     private NodeTypes() {}
 
     public static boolean isSubType(Name ntName1, final Name ntName2, final NodeTypeStorage
nodeTypes)
@@ -27,9 +31,11 @@ public final class NodeTypes {
             }, superTypes(ntName1, nodeTypes));
         }
         catch (RepositoryException e) {
+            log.error(e.getMessage(), e);
             throw e;
         }
         catch (Exception e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e);
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Paths.java
Wed Sep 21 18:31:43 2011
@@ -98,7 +98,9 @@ public final class Paths {
 
     public static String pathToString(String wspName, Path absPath) throws RepositoryException
{
         if (wspName == null || "".equals(wspName) || wspName.contains("/")) {
-            throw new RepositoryException("Invalid workspace name: " + wspName);
+            RepositoryException e = new RepositoryException("Invalid workspace name: " +
wspName);
+            log.error(e.getMessage(), e);
+            throw e;
         }
         if (!absPath.isAbsolute()) {
             IllegalArgumentException e = new IllegalArgumentException("Path is not absolute:
" + absPath);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QBinaryValue.java
Wed Sep 21 18:31:43 2011
@@ -26,6 +26,8 @@ import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.value.BinaryImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.Binary;
 import javax.jcr.PropertyType;
@@ -40,6 +42,8 @@ import java.util.Calendar;
 import static org.apache.jackrabbit.spi.commons.util.Unchecked.cast;
 
 public class QBinaryValue implements QValue {
+    private static final Logger log = LoggerFactory.getLogger(QBinaryValue.class);
+
     private final String blobId;
     private final MicroKernel microKernel;
 
@@ -72,11 +76,15 @@ public class QBinaryValue implements QVa
 
             @Override
             public int read(byte[] b, int off, int len) {
-                if (b == null) { 
-                    throw new NullPointerException();
+                if (b == null) {
+                    NullPointerException e = new NullPointerException();
+                    log.error(e.getMessage(), e);
+                    throw e;
                 }
                 else if (off < 0 || len < 0 || len > b.length - off) {
-                    throw new IndexOutOfBoundsException();
+                    IndexOutOfBoundsException e = new IndexOutOfBoundsException();
+                    log.error(e.getMessage(), e);
+                    throw e;
                 }
                 else if (len == 0) {
                     return 0;
@@ -101,6 +109,7 @@ public class QBinaryValue implements QVa
             return new BinaryImpl(is);
         }
         catch (IOException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e); 
         }
         finally {
@@ -139,6 +148,7 @@ public class QBinaryValue implements QVa
             return new BigDecimal(getString());
         }
         catch (NumberFormatException e) {
+            log.error(e.getMessage(), e);
             throw new ValueFormatException("not a valid decimal string: " + getString(),
e);
         }
     }
@@ -230,5 +240,4 @@ public class QBinaryValue implements QVa
         return 0;
     }
 
-
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/QueryProcessor.java
Wed Sep 21 18:31:43 2011
@@ -158,7 +158,7 @@ public class QueryProcessor {
             }
             r.close();
         } catch (IOException e) {
-            log.warn(e.getMessage(), e);
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Wed Sep 21 18:31:43 2011
@@ -34,6 +34,7 @@ import org.apache.jackrabbit.spi.IdFacto
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.ItemInfoCache;
+import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
@@ -41,6 +42,7 @@ import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QueryInfo;
 import org.apache.jackrabbit.spi.SessionInfo;
@@ -231,6 +233,7 @@ public class RepositoryServiceImpl exten
             queryProcessor = new QueryProcessor(microKernel, indexer, this);
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
@@ -252,8 +255,16 @@ public class RepositoryServiceImpl exten
         return ROOT_NODE_DEFINITION;
     }
 
-    //------------------------------------------< Session and Workspace handling >---
+    @Override
+    public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId
propertyId)
+            throws RepositoryException {
 
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("getPropertyDefinition");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    //------------------------------------------< Session and Workspace handling >---
 
     @Override
     protected SessionInfo createSessionInfo(SessionInfo sessionInfo, String workspaceName)
throws RepositoryException {
@@ -320,9 +331,11 @@ public class RepositoryServiceImpl exten
             });
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e );
         }
         catch (ParseException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e );
         }
 
@@ -374,6 +387,7 @@ public class RepositoryServiceImpl exten
             return buildItemInfos(nodePath, itemPath, json, false, readFromDataStore);
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
@@ -396,6 +410,7 @@ public class RepositoryServiceImpl exten
             return info.getChildInfos();
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
@@ -574,6 +589,13 @@ public class RepositoryServiceImpl exten
         subscription(subscription).dispose();
     }
 
+    @Override
+    public EventBundle getEvents(SessionInfo sessionInfo, EventFilter filter, long after)
throws RepositoryException {
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("getEvents");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
     //------------------------------------------< Query >---
 
     @Override
@@ -595,11 +617,222 @@ public class RepositoryServiceImpl exten
     public QueryInfo executeQuery(SessionInfo sessionInfo, String statement,
             String language, Map<String, String> namespaces, long limit, long offset,
Map<String, QValue> values)
             throws RepositoryException {
-        
+
         checkSessionInfo(sessionInfo);
         return queryProcessor.executeQuery(sessionInfo, statement, language, namespaces,
limit, offset, values);
     }
 
+    @Override
+    public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId,
Name destName)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("move");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId,
NodeId destParentNodeId,
+            Name destName) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("copy");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws
RepositoryException {
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("update");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId,
NodeId destParentNodeId,
+            Name destName, boolean removeExisting) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("clone");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    //------------------------------------------< Locking >---
+
+    @Override
+    public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("lock");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped,
long timeoutHint,
+            String ownerHint) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("lock");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        log.error("Not implemented: getLockInfo. Returning null", new Exception("current
stack trace"));
+        return null;
+    }
+
+    @Override
+    public void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("refreshLock");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void unlock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("unlock");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    //------------------------------------------< Versioning >---
+
+    @Override
+    public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("checkin");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("checkout");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws
RepositoryException {
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("checkout");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("checkpoint");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws
RepositoryException {
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("checkpoint");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("removeVersion");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean
removeExisting)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("restore");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void restore(SessionInfo sessionInfo, NodeId[] versionIds, boolean removeExisting)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("restore");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName,
boolean bestEffort)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("merge");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName,
boolean bestEffort,
+            boolean isShallow) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("merge");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds,
+            NodeId[] predecessorIds) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("resolveMergeConflict");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId
versionId, Name label,
+            boolean moveLabel) throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("addVersionLabel");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId
versionId, Name label)
+            throws RepositoryException {
+
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("removeVersionLabel");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public NodeId createActivity(SessionInfo sessionInfo, String title) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("createActivity");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("removeActivity");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId)
throws RepositoryException {
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("mergeActivity");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
+    @Override
+    public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("createConfiguration");
+        log.error(e.getMessage(), e);
+        throw e;
+    }
+
     //------------------------------------------< private >---
 
     private Path getPath(ItemId itemId, String wspName) throws RepositoryException {
@@ -650,7 +883,9 @@ public class RepositoryServiceImpl exten
             return cast(subscription);
         }
         else {
-            throw new RepositoryException("Invalid subscription " + subscription);
+            RepositoryException e = new RepositoryException("Invalid subscription " + subscription);
+            log.error(e.getMessage(), e);
+            throw e;
         }
     }
 
@@ -659,7 +894,9 @@ public class RepositoryServiceImpl exten
             return cast(batch);
         }
         else {
-            throw new RepositoryException("Invalid batch " + batch);
+            RepositoryException e = new RepositoryException("Invalid batch " + batch);
+            log.error(e.getMessage(), e);
+            throw e;
         }
     }
 
@@ -668,7 +905,9 @@ public class RepositoryServiceImpl exten
             return cast(sessionInfo);
         }
         else {
-            throw new RepositoryException("Invalid session " + sessionInfo);
+            RepositoryException e = new RepositoryException("Invalid session " + sessionInfo);
+            log.error(e.getMessage(), e);
+            throw e;
         }
     }
 
@@ -676,7 +915,9 @@ public class RepositoryServiceImpl exten
         SessionState state = sessions.get(sessionInfo);
 
         if (state == null) {
-            throw new RepositoryException("Invalid session");
+            RepositoryException e = new RepositoryException("Invalid session");
+            log.error(e.getMessage(), e);
+            throw e;
         }
         else {
             return state;
@@ -688,6 +929,7 @@ public class RepositoryServiceImpl exten
             sessions.put(sessionInfo, new SessionState(sessionInfo, microKernel.getHeadRevision()));
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
@@ -708,12 +950,16 @@ public class RepositoryServiceImpl exten
                     revisionId, "create workspace " + name);
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
 
     private static void copyWorkspace(String revisionId, String name, String srcWorkspaceName)
throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("Copying workspace is not supported");
+        UnsupportedRepositoryOperationException e = new UnsupportedRepositoryOperationException("Copying
workspace " +
+                "is not supported");
+        log.error(e.getMessage(), e);
+        throw e;
     }
 
     private void deleteWorkspace(String revisionId, String name)  throws RepositoryException
{
@@ -725,6 +971,7 @@ public class RepositoryServiceImpl exten
             microKernel.commit("/", "-\"" + name + '\"', revisionId, "delete workspace");
         }
         catch (MicroKernelException e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e);
         }
     }
@@ -783,6 +1030,7 @@ public class RepositoryServiceImpl exten
                 }
             }
             catch (IOException e) {
+                log.error(e.getMessage(), e);
                 throw new RepositoryException(e);
             }
         }
@@ -826,7 +1074,7 @@ public class RepositoryServiceImpl exten
 
         @Override
         public void reorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId)
throws RepositoryException {
-            log.error("Not implemented: reorderNodes");
+            log.error("Not implemented: reorderNodes. Empty implementation", new Exception("current
stack trace"));
 
             // fixme implement reorderNodes
             //throw new UnsupportedRepositoryOperationException("reorderNodes");

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
Wed Sep 21 18:31:43 2011
@@ -20,6 +20,8 @@
 package org.apache.jackrabbit.spi2microkernel;
 
 import org.apache.jackrabbit.spi.SessionInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
 import java.util.ArrayList;
@@ -27,6 +29,8 @@ import java.util.List;
 import java.util.concurrent.Callable;
 
 public class SessionState {
+    private static final Logger log = LoggerFactory.getLogger(SessionState.class);
+
     private final SessionInfo sessionInfo;
     private final List<String> commitLog = new ArrayList<String>();
 
@@ -46,6 +50,7 @@ public class SessionState {
             }
         }
         catch (Exception e) {
+            log.error(e.getMessage(), e);
             throw new RepositoryException(e.getMessage(), e); 
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Wed Sep 21 18:31:43 2011
@@ -219,6 +219,7 @@ public class SubscriptionImpl implements
                 return baseRevision;
             }
             catch (ExecutionException e) {
+                log.error(e.getMessage(), e);
                 if (e.getCause() instanceof RepositoryException) {
                     throw (RepositoryException) e.getCause();
                 }
@@ -286,6 +287,7 @@ public class SubscriptionImpl implements
                 return eventBundles;
             }
             catch (ParseException e) {
+                log.error(e.getMessage(), e);
                 throw new RepositoryException(e.getMessage(), e);
             }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java?rev=1173784&r1=1173783&r2=1173784&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/Values.java
Wed Sep 21 18:31:43 2011
@@ -274,9 +274,11 @@ public final class Values {
                         return binaryHandler.apply(val.substring(2));
                     }
                     catch (RepositoryException e) {
+                        log.error(e.getMessage(), e);
                         throw e;
                     }
                     catch (Exception e) {
+                        log.error(e.getMessage(), e);
                         throw new RepositoryException(e.getMessage(), e);
                     }
                 }
@@ -285,7 +287,9 @@ public final class Values {
                 }
 
                 if (valueFactory == null) {
-                    throw new RepositoryException("Not supported value " + value);
+                    RepositoryException e = new RepositoryException("Not supported value
" + value);
+                    log.error(e.getMessage(), e);
+                    throw e;
                 }
                 else {
                     return valueFactory.create(val.substring(2));
@@ -296,7 +300,9 @@ public final class Values {
         // Non type encoded value
         ValueFactory valueFactory = VALUE_FACTORIES.get(value.getClass());
         if (valueFactory == null) {
-            throw new RepositoryException("Not supported value " + value);
+            RepositoryException e = new RepositoryException("Not supported value " + value);
+            log.error(e.getMessage(), e);
+            throw e;
         }
         else {
             return valueFactory.create(value);
@@ -382,9 +388,11 @@ public final class Values {
                     }
                 }
                 catch (RepositoryException e) {
+                    log.error(e.getMessage(), e);
                     throw e;
                 }
                 catch (Exception e) {
+                    log.error(e.getMessage(), e);
                     throw new RepositoryException(e.getMessage(), e);
                 }
 
@@ -393,8 +401,10 @@ public final class Values {
                 return quoteAndEncode(type, JsonBuilder.escape(value.getString()));
 
             default:
-                throw new RepositoryException("Cannot handle value of type " +
+                RepositoryException e = new RepositoryException("Cannot handle value of type
" +
                         nameFromValue(value.getType()));
+                log.error(e.getMessage(), e);
+                throw e;
         }
     }
 



Mime
View raw message