Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64708176C6 for ; Thu, 9 Oct 2014 10:18:17 +0000 (UTC) Received: (qmail 97009 invoked by uid 500); 9 Oct 2014 10:18:16 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 96947 invoked by uid 500); 9 Oct 2014 10:18:16 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 96936 invoked by uid 99); 9 Oct 2014 10:18:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 10:18:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marcel.offermans@luminis.eu designates 157.56.112.147 as permitted sender) Received: from [157.56.112.147] (HELO emea01-am1-obe.outbound.protection.outlook.com) (157.56.112.147) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 10:18:11 +0000 Received: from marcels-mbp.fritz.box (82.95.193.148) by DB3PR03MB265.eurprd03.prod.outlook.com (10.242.131.146) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Thu, 9 Oct 2014 10:17:46 +0000 Content-Type: text/plain; charset="windows-1252" MIME-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Dependency Manager: registering FrameworkListener From: Marcel Offermans In-Reply-To: <54363311.30502@romandie.com> Date: Thu, 9 Oct 2014 12:17:42 +0200 Content-Transfer-Encoding: quoted-printable Message-ID: References: <1412590425931-5010083.post@n6.nabble.com> <54329EB2.8050301@ungoverned.org> <5434EF26.3090804@romandie.com> <54363311.30502@romandie.com> To: X-Mailer: Apple Mail (2.1878.6) X-Originating-IP: [82.95.193.148] X-ClientProxiedBy: AM3PR05CA018.eurprd05.prod.outlook.com (10.141.192.28) To DB3PR03MB265.eurprd03.prod.outlook.com (10.242.131.146) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DB3PR03MB265; X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(51694002)(51704005)(53754006)(252514010)(199003)(43784003)(189002)(74482002)(19580405001)(50226001)(4396001)(80022003)(76176999)(50986999)(50466002)(21056001)(20776003)(66066001)(101416001)(102836001)(97736003)(46102003)(19580395003)(33656002)(82746002)(47776003)(69596002)(83716003)(64706001)(86362001)(92566001)(92726001)(89996001)(93916002)(23746002)(110136001)(105586002)(85852003)(62966002)(87976001)(87286001)(88136002)(81156004)(53416004)(57306001)(77096002)(106356001)(42186005)(120916001)(95666004)(104166001)(85306004)(93886004)(99396003)(31966008)(76482002)(77156001)(2351001)(107886001)(107046002)(36756003)(122386002)(40100002)(104396001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB3PR03MB265;H:marcels-mbp.fritz.box;FPR:;MLV:sfv;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-OriginatorOrg: luminis.eu X-Virus-Checked: Checked by ClamAV on apache.org Let me reverse the question: what would be a newer/better way and how = should that be implemented. I mean I can see somebody writing a = whiteboard style handler and donating it to (for example) Felix. Is that = what you would like, or?? On 09 Oct 2014, at 9:02 am, Bulu wrote: > Hello Marcel > Yes I already knew the standard way you describe. I just wanted to = clarify whether a newer/better method existed. >=20 > Thanks again for your answer. > Philipp >=20 > On 08.10.2014 11:24, Marcel Offermans wrote: >> =46rom the spec: "A FrameworkListener object is registered with the = Framework using the BundleContext.addFrameworkListener method.=94 >>=20 >> So it is not whiteboard-style (it pre-dates the whiteboard pattern = afaik). >>=20 >> In DM I would do: >>=20 >> in the init: >> dm.add(createComponent().setImplementation(Comp.class)); >>=20 >> and then the component: >> public class Comp implements FrameworkListener { >> private volatile BundleContext m_context; >> public void start() { >> m_context.addFrameworkListener(this); >> } >> public void stop() { >> m_context.removeFrameworkListener(this); >> } >> // implement the FrameworkListener methods here >> } >>=20 >> of course it would also be possible to create a whiteboard style = handler for this (just like one exists to handle Servlets for = HttpService)=85 >>=20 >> Greetings, Marcel >>=20 >> On 8 Oct 2014 at 10:06:01 , Bulu (bulu@romandie.com) wrote: >>=20 >> Hello all >>=20 >> I'm declaring a component using DM which gets created when all >> dependencies are met. This component should also get notified of >> framework events and thus implements FrameworkListener. >>=20 >> Does the OSGi framework also use a whiteboard pattern for delivering >> these events, meaning I only need to publish my component as a >> FrameworkListener.class service and it will get called by the = framework >> when needed? >>=20 >> If not, is there an elegant way of registering it using DM? >>=20 >> Thanks & regards >> Philipp >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org >> For additional commands, e-mail: users-help@felix.apache.org >>=20 >>=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org