Expand my Community achievements bar.

Custom Component doesn't bind to Service

Avatar

Level 4

Hi Everyone,

I am trying change the default the ContentSyncManager implmentaion provided by Adobe . So I created a class CustomContentSyncManagerImpl class as shown below

@Component(metatype=true, label="Day CQ Content Sync Manager", description="Responsible for cache updates and content delivery using zip files.",immediate=true)

@Service

@Properties({@org.apache.felix.scr.annotations.Property(name = "service.ranking", intValue=10000)})

public class CustomContentSyncManagerImpl   implements ContentSyncManager

I am able to achieve my use case but the only issue is until the I restart the bundle "com.day.cq.wcm.cq-wcm-content-sync"(id =412 , AEM 6.3 ) my custom component is not being called only the default implementation is being called.

I am using high ranking and immediate=true,I could see both the custom and default components in Active status.  I wonder why my component is not getting attached to the service.

Is there is way to achieve this without restarting the other bundle ? I had thought like restarting the bundle programatically using bundle activator which doesnt sound like a good option .

Thanks,

Krishna

3 Replies

Avatar

Level 10

You may have to restart the bundle in this use case.

Avatar

Level 4

Thanks for the reply smacdonald2008

Just curious on why we need to restart the bundle. Having a high ranking should  have made sure custom component to bind , isn't it ?

Avatar

Level 10

I ahve noticed sometimes it resets data values and fixes issues.