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 B561A10B5F for ; Thu, 16 Jan 2014 11:30:26 +0000 (UTC) Received: (qmail 97475 invoked by uid 500); 16 Jan 2014 11:30:23 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 97180 invoked by uid 500); 16 Jan 2014 11:30:22 -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 97130 invoked by uid 99); 16 Jan 2014 11:30:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jan 2014 11:30:19 +0000 Date: Thu, 16 Jan 2014 11:30:19 +0000 (UTC) From: "james strachan (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FELIX-4392) make @Property use RetentionPolicy.RUNTIME so that code can use runtime field/setter injecting property values 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-4392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13873291#comment-13873291 ] james strachan commented on FELIX-4392: --------------------------------------- OK thanks for the heads up! Lets close this then. > make @Property use RetentionPolicy.RUNTIME so that code can use runtime field/setter injecting property values > -------------------------------------------------------------------------------------------------------------- > > Key: FELIX-4392 > URL: https://issues.apache.org/jira/browse/FELIX-4392 > Project: Felix > Issue Type: Improvement > Components: SCR Annotations > Reporter: james strachan > > It'd be nice to be able to write a base class for a @Component with an @Activate method taking the Map of configurations and performing field or setter injection of configurations via @Property - but the annotation is not retained at runtime right now due to CLASS not RUNTIME RetentionPolicy on @Property. > Any idea why not? Was this on purpose or just an oversight? > e.g. it'd be nice to be able to code components like this (and get the SCR and MetaType metadata auto-generated) > {code} > public abstract class MyAbstractComponent { > @Activate > public void activate(Map configuration) throws Exception { > // use introspection to find the fields and setters with @Property annotated... > } > } > ... > @Component(name = "foo") > public FooComponent extends MyAbstractComponent { > @Property > private int foo; > @Property > private String bar; > .... > {code} -- This message was sent by Atlassian JIRA (v6.1.5#6160)