felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Pozolotin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-2963) scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
Date Mon, 06 Jun 2011 16:40:58 GMT

    [ https://issues.apache.org/jira/browse/FELIX-2963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044942#comment-13044942
] 

Andrei Pozolotin commented on FELIX-2963:
-----------------------------------------

Carsten:

here is a project:
https://github.com/carrot-garden/carrot-bugger/tree/master/carrot-bug-FELIX-2963-001

base class:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/src/main/java/bench/CompBase.java

class inherited from base:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/src/main/java/bench/CompInherited.java

result xml:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/example/serviceComponents.xml

steps to reproduce:
https://github.com/carrot-garden/carrot-bugger/blob/master/carrot-bug-FELIX-2963-001/launch/reproduce.sh

problem:
activate / deactivate annotations are present on the base class, but they do not make it into
xml when inherited;

thanks again,

Andrei.

> scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
> ---------------------------------------------------------------------------------------
>
>                 Key: FELIX-2963
>                 URL: https://issues.apache.org/jira/browse/FELIX-2963
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR), Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.7.0,  scr-1.6.0
>            Reporter: Andrei Pozolotin
>            Assignee: Carsten Ziegeler
>
> // 1)  when I use a base component with scr lifecycle annotations:
> @Component(componentAbstract = true)
> public abstract class BasePluginEDT {
> 	@Activate
> 	protected final void activateEDT(final Map<String, String> config) {
> 	@Deactivate
> 	protected final void deactivateEDT(final Map<String, String> config) {
> 	@Modified
> 	protected final void modifiedEDT(final Map<String, String> config) {
> // 2) which is inherited by a derived component:
> @Service
> @Component(name = PluginSpaceService.PID, policy = ConfigurationPolicy.REQUIRE, immediate
= true)
> public class BucketPlugin extends BasePluginEDT implements PluginSpaceService {
> // 3) then xml for the derived component does not show annotated methods from the parent
>     <scr:component enabled="true" immediate="true" name="barchart.service.space" configuration-policy="require">
>         <implementation class="com.ddfplus.core.space.BucketPlugin"/>
>         <service servicefactory="false">
>             <provide interface="com.ddfplus.api.plugin.PluginSpaceService"/>
>         </service>
>         <property name="service.pid" type="String" value="barchart.service.space"/>
>         <reference name="beanService" interface="com.ddfplus.api.host.HostBeanService"
cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
>         <reference name="dispService" interface="com.ddfplus.api.host.HostDisplayService"
cardinality="1..1" policy="static" bind="bind" unbind="unbind"/>
>     </scr:component>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message