sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r933746 - /sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java
Date Tue, 13 Apr 2010 19:13:17 GMT
Author: justin
Date: Tue Apr 13 19:13:17 2010
New Revision: 933746

URL: http://svn.apache.org/viewvc?rev=933746&view=rev
Log:
SLING-1488 - adding dispose method

Modified:
    sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java

Modified: sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java?rev=933746&r1=933745&r2=933746&view=diff
==============================================================================
--- sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java
(original)
+++ sling/trunk/bundles/commons/testing/src/main/java/org/apache/sling/commons/testing/jcr/EventHelper.java
Tue Apr 13 19:13:17 2010
@@ -53,7 +53,7 @@ public class EventHelper implements Even
 	}
 
     public void onEvent(EventIterator it) {
-    	eventCount++;
+        eventCount++;
     }
 
     /** To make sure observation events have been delivered,
@@ -82,4 +82,14 @@ public class EventHelper implements Even
     		throw new IllegalStateException("Event counter did not reach " + targetEventCount +
", waited " + timeoutMsec + " msec");
     	}
     }
+
+    /**
+     * Remove the event listener from the observation listener.
+     */
+    public void dispose() {
+        try {
+            session.getWorkspace().getObservationManager().removeEventListener(this);
+        } catch (RepositoryException e) {
+        }
+    }
 }



Mime
View raw message