Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 5798 invoked from network); 27 Jan 2010 10:40:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2010 10:40:06 -0000 Received: (qmail 25191 invoked by uid 500); 27 Jan 2010 10:40:06 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 25122 invoked by uid 500); 27 Jan 2010 10:40:06 -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 25112 invoked by uid 99); 27 Jan 2010 10:40:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 10:40:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jan 2010 10:39:55 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7A275234C1EE for ; Wed, 27 Jan 2010 02:39:34 -0800 (PST) Message-ID: <1517180840.77021264588774485.JavaMail.jira@brutus.apache.org> Date: Wed, 27 Jan 2010 10:39:34 +0000 (UTC) From: "Felix Meschberger (JIRA)" To: dev@felix.apache.org Subject: [jira] Commented: (FELIX-2010) activate on component not called if specified in class and omitted from xml In-Reply-To: <243130552.54991264559074517.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/FELIX-2010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805464#action_12805464 ] Felix Meschberger commented on FELIX-2010: ------------------------------------------ > Sorry. No problem. Glad the thing works as expected ;-) > activate on component not called if specified in class and omitted from xml > --------------------------------------------------------------------------- > > Key: FELIX-2010 > URL: https://issues.apache.org/jira/browse/FELIX-2010 > Project: Felix > Issue Type: Bug > Components: Declarative Services (SCR) > Affects Versions: scr-1.4.0 > Environment: Mac OS X > java version "1.6.0_17" > Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025) > Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode) > Reporter: Christopher Brind > Attachments: scrtest-fails.jar, scrtest-works.jar > > > The component descriptor does not have to explicitly specify the activate and deactivate methods. However, if activate/deactivate are in the class then they should still be called at the appropriate time. > So for example the following code only prints "Hello world!" when the activate method is specified explicitly in the component descriptor xml. > public class FooComponent { > // the same seems to apply regardless of the signature > public void activate() { > System.out.println("Hello world!"); > } > } > This XML causes "Hello world!" to appear: > > > > > But this XML does not: > > > > > I could not quote a specific reference from the OSGi spec, but generally the latter example of XML is how the examples are structured (i.e. with implicit activate methods), for example see section 112.2.2 (Immediate Component) of the OSGi 4.2 compendium. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.