Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7DDFA78BF for ; Mon, 12 Sep 2011 18:33:31 +0000 (UTC) Received: (qmail 65818 invoked by uid 500); 12 Sep 2011 18:33:31 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 65563 invoked by uid 500); 12 Sep 2011 18:33:30 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 65555 invoked by uid 99); 12 Sep 2011 18:33:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Sep 2011 18:33:30 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Sep 2011 18:33:29 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 02E1C941C4 for ; Mon, 12 Sep 2011 18:33:09 +0000 (UTC) Date: Mon, 12 Sep 2011 18:33:08 +0000 (UTC) From: "Richard S. Hall (JIRA)" To: dev@felix.apache.org Message-ID: <617249168.18311.1315852388991.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1188365179.1667.1314772630259.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (FELIX-3096) Could not add FrameworkListener from ServiceListener MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-3096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13102887#comment-13102887 ] Richard S. Hall commented on FELIX-3096: ---------------------------------------- After more investigation, I think I've come to a way to resolve this. Due to some unrelated event dispatching refactoring for R4.3, we might be able to allow listeners to be added without holding the bundle lock. I still need to investigate it a little more, but so far so good. > Could not add FrameworkListener from ServiceListener > ---------------------------------------------------- > > Key: FELIX-3096 > URL: https://issues.apache.org/jira/browse/FELIX-3096 > Project: Felix > Issue Type: Bug > Affects Versions: framework-3.2.2 > Reporter: Vlad Arkhipov > Priority: Critical > Fix For: framework-4.0.0 > > > It's now impossible to add a FrameworkListener from ServiceListener in 3.2.x, worked in 3.0.9. The code below hangs in addFrameworkListener when it tries to acquire a global lock on the framework bundle. > Framework framework = ... > framework.init(); > final BundleContext ctx = framework.getBundleContext(); > ctx.addServiceListener(new ServiceListener() { > public void serviceChanged(ServiceEvent event) { > if (...) { > ctx.addFrameworkListener(new FrameworkListener() { > public void frameworkEvent(FrameworkEvent event) { > System.out.println(event); > } > }); > } > } > }); > StartLevel sl = (StartLevel) ctx.getService(ctx.getServiceReference(StartLevel.class.getName())); > // Install bundles, set start level. > ... > framework.start(); > framework.waitForStop(); -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira