Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 82528 invoked from network); 7 Feb 2009 07:53:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2009 07:53:33 -0000 Received: (qmail 90049 invoked by uid 500); 7 Feb 2009 07:53:32 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 90023 invoked by uid 500); 7 Feb 2009 07:53:31 -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 90012 invoked by uid 99); 7 Feb 2009 07:53:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 23:53:31 -0800 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; Sat, 07 Feb 2009 07:53:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B178D234C4B0 for ; Fri, 6 Feb 2009 23:52:59 -0800 (PST) Message-ID: <578746754.1233993179725.JavaMail.jira@brutus> Date: Fri, 6 Feb 2009 23:52:59 -0800 (PST) From: "Felix Meschberger (JIRA)" To: dev@felix.apache.org Subject: [jira] Created: (FELIX-925) Extend SCR to allow alternate activate and deactivate method signatures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Extend SCR to allow alternate activate and deactivate method signatures ----------------------------------------------------------------------- Key: FELIX-925 URL: https://issues.apache.org/jira/browse/FELIX-925 Project: Felix Issue Type: New Feature Components: Declarative Services (SCR) Affects Versions: scr-1.0.6 Environment: OSGi RFC-0134, OSGi R4.2 Early Draft 2 (http://www.os= gi.org/download/osgi-4.2-early-draft2.pdf) Reporter: Felix Meschberger Fix For: scr-1.2.0 A way is needed to avoid using DS API at all in components with SCR. This m= eans the activate and deactivate methods should not require the ComponentCo= ntext parameter. We should also allow the names of the activate and deactiv= ate methods to be specified to avoid requiring specific method names. To support this, the follow attributes will be added to the component eleme= nt: The activate attribute will specify the name of the activate method and the= deactivate attribute will specify the name of the deactivate method. The signature for the activate and deactivate methods is: p r o t e c t ed vo i d (< a r gumen t= s > ) ; can be zero or more arguments. For the activate method each argument must be of one of the following types= : =E2=97=8F ComponentContext - the Component Context for the component =E2=97=8F BundleContext - the Bundle Context of the component's bund= le =E2=97=8F Map - the Component Properties from ComponentContext.getPr= operties. If any argument of the activate method is not one of the above types, SCR m= ust log an error message with the Log Service, if present, and the componen= t configuration is not activated. For the deactivate method each argument must be of one of the following typ= es: =E2=97=8F int/Integer - the deactivation reason =E2=97=8F ComponentContext - the Component Context for the component =E2=97=8F BundleContext - the Bundle Context of the component's bund= le =E2=97=8F Map - the Component Properties from ComponentContext.getPr= operties. If any argument of the deactivate method is not one of the above types, SCR= must log an error message with the Log Service, if present, and the deacti= vation of the component configuration will continue. The methods may also be declared public. The same rules as specified in 112= .5.8 will be used to locate the activate and deactivate methods in the impl= ementation class hierarchy. 3.2.1 Component deactivation reasons When a component is deactivated, the reason for the deactivation can be pas= sed to the deactivate method. The following deactivation reasons are specif= ied in ComponentConstants. /** * The reason the component instance was deactivated is u= nspecified. * * @since 1.1 */ public static final int DEACTIVATION_REASON_UNSPECIFIED = =3D 0; /** * The component instance was deactivated because the com= ponent was disabled. * * @since 1.1 */ public static final int DEACTIVATION_REASON_DISABLED =3D 1= ; /** * The component instance was deactivated because a refer= ence became unsatisfied. * * @since 1.1 */ public static final int DEACTIVATION_REASON_REFERENCE =3D= 2; /** * The component instance was deactivated because its con= figuration was changed. * * @since 1.1 */ public static final int DEACTIVATION_REASON_CONFIGURATION= _MODIFIED =3D 3; /** * The component instance was deactivated because its con= figuration was deleted. * * @since 1.1 */ public static final int DEACTIVATION_REASON_CONFIGURATION= _DELETED =3D 4; /** * The component instance was deactivated because the com= ponent was disposed. * * @since 1.1 */ public static final int DEACTIVATION_REASON_DISPOSED =3D = 5; /** * The component instance was deactivated because the bun= dle was stopped. * * @since 1.1 */ public static final int DEACTIVATION_REASON_BUNDLE_STOPPE= D =3D 6; --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.