jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1138353 - in /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel: SessionState.java SubscriptionImpl.java
Date Wed, 22 Jun 2011 09:20:48 GMT
Author: mduerig
Date: Wed Jun 22 09:20:48 2011
New Revision: 1138353

URL: http://svn.apache.org/viewvc?rev=1138353&view=rev
Log:
spi2microkernel prototype (WIP)
observation (WIP)

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

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=1138353&r1=1138352&r2=1138353&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 Jun 22 09:20:48 2011
@@ -41,7 +41,7 @@ public class SessionState {
 
     public void commitWithLock(Callable<String> commit) throws RepositoryException
{
         try {
-            synchronized (this) {
+            synchronized (commitLog) {
                 commitLog.add(commit.call());
             }
         }
@@ -50,6 +50,12 @@ 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
@@ -61,5 +67,4 @@ public class SessionState {
         }
         return commitLog;
     }
-
 }

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1138353&r1=1138352&r2=1138353&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Wed Jun 22 09:20:48 2011
@@ -163,7 +163,6 @@ public class SubscriptionImpl implements
             String changes = getString(jsonObject, "changes");
             Collection<Event> events = getEvents(changes, eventTemplate);
 
-            // fixme: revisionInfos.map(_.getRevisionId)
             boolean isLocal = commitLog.contains(revisionId);  // todo performance: this
does a linear search on the list
 
             // events.filter(event => eventFilters.all(_.accept(event, isLocal))
@@ -199,7 +198,9 @@ public class SubscriptionImpl implements
 
         // Event#NODE_ADDED} Event#NODE_REMOVED} Event#PROPERTY_ADDED} Event#PROPERTY_REMOVED}
         // Event#PROPERTY_CHANGED} Event#NODE_MOVED} Event#PERSIST}
-        private Event addNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate, Collection<Event>
events) {
+        private void addNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate, Collection<Event>
events) {
+            EventTemplate addNodeEvent = eventTemplate.copy();
+
             // todo implement addNode
             Path path = null;
             ItemId itemId = null;
@@ -212,19 +213,19 @@ public class SubscriptionImpl implements
 
             String userData = null;
 
-            return eventTemplate.buildEvent();
+            events.add(addNodeEvent.buildEvent());
         }
 
-        private Event removeNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
-            return null; // todo implement removeNode
+        private void removeNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
+            // todo implement removeNode
         }
 
-        private Event setProperty(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
-            return null; // todo implement setProperty
+        private void setProperty(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
+            // todo implement setProperty
         }
 
-        private Event moveNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate,
Collection<Event> events) {
-            return null; // todo implement moveNode
+        private void moveNode(JsopTokenizer jsopTokenizer, EventTemplate eventTemplate, Collection<Event>
events) {
+            // todo implement moveNode
         }
 
         private String getString(JSONObject jsonObject, String key) {



Mime
View raw message