clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: CLEREZZA-848: making sure the thread is non-null before the bundle-listener is registered
Date Wed, 04 Dec 2013 16:07:51 GMT
Updated Branches:
  refs/heads/master 35448624b -> aec88f543


CLEREZZA-848: making sure the thread is non-null before the bundle-listener is registered

Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/aec88f54
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/aec88f54
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/aec88f54

Branch: refs/heads/master
Commit: aec88f543044d22244cec815d04dd0432affec45
Parents: 3544862
Author: retobg <reto@apache.org>
Authored: Wed Dec 4 17:07:32 2013 +0100
Committer: retobg <reto@apache.org>
Committed: Wed Dec 4 17:07:32 2013 +0100

----------------------------------------------------------------------
 .../clerezza/platform/content/fsadaptor/BundleFsLoader.scala  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/aec88f54/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
----------------------------------------------------------------------
diff --git a/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
b/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
index d9548c1..645dab1 100644
--- a/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
+++ b/platform.content.fsadaptor/src/main/scala/org/apache/clerezza/platform/content/fsadaptor/BundleFsLoader.scala
@@ -140,12 +140,12 @@ class BundleFsLoader extends BundleListener with Logger with WeightedTcProvider
           if bundle.getState == Bundle.ACTIVE) {
         bundleList ::= bundle
       }
-      context.getBundleContext().addBundleListener(this);
       updateCache
       tcManager.getTcAccessController.setRequiredReadPermissions(
           RESOURCE_MGRAPH_URI, Collections.singleton(new TcPermission(Constants.CONTENT_GRAPH_URI_STRING,
TcPermission.READ)))
       cgProvider.addTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
       updateThread = new UpdateThread()
+      context.getBundleContext().addBundleListener(this);
     }
   }
   protected def deactivate(context: ComponentContext) {
@@ -154,6 +154,7 @@ class BundleFsLoader extends BundleListener with Logger with WeightedTcProvider
       updateThread.interrupt()
       cgProvider.removeTemporaryAdditionGraph(RESOURCE_MGRAPH_URI)
       tcManager.deleteTripleCollection(currentCacheUri);
+      updateThread == null;
     }
   }
 
@@ -238,6 +239,10 @@ class BundleFsLoader extends BundleListener with Logger with WeightedTcProvider
 
 
   def bundleChanged(event: BundleEvent) {
+    val updateThread = this.updateThread
+    if (updateThread == null) {
+      BundleFsLoader.log.error("UpdateThread is null, yet we get bundle Events")
+    }
     val bundle = event.getBundle();
     event.getType() match  {
       case BundleEvent.STARTED => {


Mime
View raw message