Return-Path: X-Original-To: apmail-clerezza-commits-archive@www.apache.org Delivered-To: apmail-clerezza-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 59E7810693 for ; Wed, 4 Dec 2013 16:07:55 +0000 (UTC) Received: (qmail 96158 invoked by uid 500); 4 Dec 2013 16:07:54 -0000 Delivered-To: apmail-clerezza-commits-archive@clerezza.apache.org Received: (qmail 96129 invoked by uid 500); 4 Dec 2013 16:07:53 -0000 Mailing-List: contact commits-help@clerezza.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@clerezza.apache.org Delivered-To: mailing list commits@clerezza.apache.org Received: (qmail 96122 invoked by uid 99); 4 Dec 2013 16:07:52 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 16:07:52 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C4485B5C9; Wed, 4 Dec 2013 16:07:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: reto@apache.org To: commits@clerezza.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: CLEREZZA-848: making sure the thread is non-null before the bundle-listener is registered Date: Wed, 4 Dec 2013 16:07:51 +0000 (UTC) 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 Authored: Wed Dec 4 17:07:32 2013 +0100 Committer: retobg 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 => {