jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r498615 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Date Mon, 22 Jan 2007 13:44:30 GMT
Author: mreutegg
Date: Mon Jan 22 05:44:29 2007
New Revision: 498615

URL: http://svn.apache.org/viewvc?view=rev&rev=498615
Log:
SPI: only create event polling thread if observation is supported by repository service.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?view=diff&rev=498615&r1=498614&r2=498615
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Mon Jan 22 05:44:29 2007
@@ -374,10 +374,19 @@
      *         <code>RepositoryService</code> does not support observation.
      */
     private Thread createChangeFeed(int pollingInterval) {
-        Thread t = new Thread(new ChangePolling(pollingInterval));
-        t.setName("Change Polling");
-        t.setDaemon(true);
-        t.start();
+        Thread t = null;
+        try {
+            String desc = (String) service.getRepositoryDescriptors().get(
+                    Repository.OPTION_OBSERVATION_SUPPORTED);
+            if ("true".equals(desc)) {
+                t = new Thread(new ChangePolling(pollingInterval));
+                t.setName("Change Polling");
+                t.setDaemon(true);
+                t.start();
+            }
+        } catch (RepositoryException e) {
+            log.warn("Unable to get repository descriptors: " + e);
+        }
         return t;
     }
 



Mime
View raw message