felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (FELIX-2963) scr annotations @Activate @Deactivate @Modified are not detected with class inheritance
Date Wed, 10 Aug 2011 08:51:27 GMT

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

Chetan Mehrotra edited comment on FELIX-2963 at 8/10/11 8:50 AM:
-----------------------------------------------------------------

I am facing the same issue. I tried to debug it and following flow is happening

1. org.apache.felix.scrplugin.SCRDescriptorGenerator#checkLifecycleMethod is called with "activate"
2. It invokes the desc.getTagByName( Constants.COMPONENT )
3. The desc in this case is org.apache.felix.scrplugin.tags.cl.ClassLoaderJavaClassDescription#getTagByName

This method implementation is currently empty. However the component field has the required
activate method name populated. So may be we need to use logic as done in getTagsByName

      was (Author: chetanm):
    I am facing the same issue. I tried to debug it and following flow is happening

# org.apache.felix.scrplugin.SCRDescriptorGenerator#checkLifecycleMethod is called with "activate"
# It invokes the desc.getTagByName( Constants.COMPONENT )
# The desc in this case is org.apache.felix.scrplugin.tags.cl.ClassLoaderJavaClassDescription#getTagByName

This method implementation is currently empty. However the component field has the require
activate method name populated
  
> 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: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.7.0, scr generator 1.1.0
>            Reporter: Andrei Pozolotin
>            Assignee: Carsten Ziegeler
>             Fix For: maven-scr-plugin-1.7.2, scr generator 1.1.2
>
>
> // 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