You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2008/01/18 18:00:20 UTC

svn commit: r613204 - /incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java

Author: cziegeler
Date: Fri Jan 18 09:00:19 2008
New Revision: 613204

URL: http://svn.apache.org/viewvc?rev=613204&view=rev
Log:
Move session creation into same thread which is using the session.

Modified:
    incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java

Modified: incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java?rev=613204&r1=613203&r2=613204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java (original)
+++ incubator/sling/trunk/sling/event/src/main/java/org/apache/sling/event/impl/AbstractRepositoryEventHandler.java Fri Jan 18 09:00:19 2008
@@ -103,20 +103,24 @@
      * @param context
      * @throws RepositoryException
      */
-    protected void activate(final ComponentContext context)
-    throws RepositoryException {
+    protected void activate(final ComponentContext context) {
         this.applicationId = context.getBundleContext().getProperty(SLING_ID);
         this.repositoryPath = (String)context.getProperties().get(CONFIG_PROPERTY_REPO_PATH);
         final Integer i = (Integer)context.getProperties().get(CONFIG_PROPERTY_CLEANUP_PERIOD);
         if ( i != null ) {
             this.cleanupPeriod = i;
         }
-        this.startSession();
         // start background thread
         this.running = true;
         final Thread t = new Thread() {
             public void run() {
-                runInBackground();
+                try {
+                    startSession();
+                    runInBackground();
+                } catch (RepositoryException e) {
+                    // there is nothing we can do except log!
+                    logger.error("Error during session starting.", e);
+                }
             }
         };
         t.start();