jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1148802 - in /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel: RepositoryServiceImpl.java SessionState.java
Date Wed, 20 Jul 2011 14:46:49 GMT
Author: mduerig
Date: Wed Jul 20 14:46:48 2011
New Revision: 1148802

URL: http://svn.apache.org/viewvc?rev=1148802&view=rev
Log:
spi2microkernel (WIP)
- sessions cannot see each other changes

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1148802&r1=1148801&r2=1148802&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Wed Jul 20 14:46:48 2011
@@ -160,7 +160,7 @@ public class RepositoryServiceImpl exten
     }
 
     public String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException
{
-        String rev = sessionState(sessionInfo).getHeadRevision();
+        String rev = microKernel.getHeadRevision();
 
         // Names of first level nodes correspond to workspace names
         final List<String> workspaces = new ArrayList<String>();
@@ -225,7 +225,7 @@ public class RepositoryServiceImpl exten
             String wspName = sessionInfo.getWorkspaceName();
             Path path = getPath(nodeId);
             String mkPath = Paths.pathToString(wspName, path);
-            String rev = sessionState(sessionInfo).getHeadRevision();
+            String rev = microKernel.getHeadRevision();
 
             if (microKernel.nodeExists(mkPath, rev)) {
                 String json = microKernel.getNodes(mkPath, rev);
@@ -245,7 +245,7 @@ public class RepositoryServiceImpl exten
             String wspName = sessionInfo.getWorkspaceName();
             Path path = getPath(nodeId);
             String mkPath = Paths.pathToString(wspName, path);
-            String rev = sessionState(sessionInfo).getHeadRevision();
+            String rev = microKernel.getHeadRevision();
 
             NodeInfo info = null;
             if (microKernel.nodeExists(mkPath, rev)) {
@@ -270,7 +270,7 @@ public class RepositoryServiceImpl exten
             String wspName = sessionInfo.getWorkspaceName();
             Path path = propertyId.getPath();
             String mkPath = Paths.pathToString(wspName, path.getAncestor(1));
-            String rev = sessionState(sessionInfo).getHeadRevision();
+            String rev = microKernel.getHeadRevision();
 
             PropertyInfo info = null;
             if (microKernel.nodeExists(mkPath, rev)) {
@@ -321,7 +321,7 @@ public class RepositoryServiceImpl exten
 
     @Override
     public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName)
throws RepositoryException {
-        String rev = sessionState(sessionInfo).getHeadRevision();
+        String rev = microKernel.getHeadRevision();
         if (srcWorkspaceName == null) {
             createWorkspace(rev, name, false);
         }
@@ -332,7 +332,7 @@ public class RepositoryServiceImpl exten
 
     @Override
     public void deleteWorkspace(SessionInfo sessionInfo, String name) throws RepositoryException
{
-        String rev = sessionState(sessionInfo).getHeadRevision();
+        String rev = microKernel.getHeadRevision();
         deleteWorkspace(rev, name);
     }
 
@@ -592,7 +592,7 @@ public class RepositoryServiceImpl exten
         public void commit() throws RepositoryException {
             sessionState(sessionInfo).commitWithLock(new Callable<String>() {
                 public String call() throws RepositoryException {
-                    String rev = sessionState(sessionInfo).getHeadRevision();
+                    String rev = microKernel.getHeadRevision();
                     return microKernel.commit("/", jsop.toString(), rev, ((SessionInfoImpl)
sessionInfo).getUserData());
                 }
             });

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java?rev=1148802&r1=1148801&r2=1148802&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SessionState.java
Wed Jul 20 14:46:48 2011
@@ -50,12 +50,6 @@ public class SessionState {
         }
     }
 
-    public String getHeadRevision() {
-        synchronized (commitLog) {
-            return commitLog.get(commitLog.size() - 1);
-        }
-    }
-
     /**
      * Snapshot of this session state's commit log at the time of the call
      * @return



Mime
View raw message